在新的VPS上搭的Wordpress博客发文章后,修改了固定链接为自定义结构的/%post_id%.html,结果页面报404。搜索一番后,是Apache2的mod_rewrite功能未打开所致,具体解决步骤如下:
1:在shell下调用sudo a2enmod rewrite
2:进入/etc/apace2/sites-available,然后打开对应的站点配置文件的AllowOverride None改成AllowOverride All

<directory> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </directory>
改为
<directory> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </directory>

3:sudo service apache2 restart