【发布时间】:2016-05-17 05:33:25
【问题描述】:
问题
我已经安装了一个 Wordpress。我打开了漂亮的永久链接(帖子名称)。主页以外的任何页面都是404 Not Found。这似乎表明存在重写问题。
我的设置
乌布努图 14.04
使用 localhost 作为我的 URL
我的 apache 配置是 /etc/apache2/sites-available/000-default.conf
我的wordpress位于/var/www/wordpress/
我的相关htaccess位于/var/www/wordpress/.htaccess
我的尝试
当我运行 a2enmod rewrite 时,我得到了
Module rewrite already enabled
我的.htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
我的000-default.conf 文件 apache 配置
<Directory /var/www/wordpress/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
我已经尝试了规范问题的所有答案。
How to enable mod_rewrite for Apache 2.2
我的问题
为什么我的重写不起作用?
【问题讨论】:
-
你的 Apache 版本也是 2.2 吗?
-
检查
apache2ctl -t -D DUMP_MODULES和apache2ctl -t -D DUMP_VHOSTS,另请参阅您的日志文件。为您的问题添加相关输出。
标签: php wordpress apache .htaccess mod-rewrite