【发布时间】:2014-06-16 18:39:02
【问题描述】:
我已在我的 apache2 服务器 wordpress 站点上安装,但所有永久链接都不起作用(未找到 404) 我的 .htaccess 是由 wp 生成的
# 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
我的这个网站的 conf 文件:
<Directory /home/sergey/siteName>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
anythingfromthoseanswersdoesnot帮帮我
谢谢。
UPD:
感谢 Justin Iurman 的评论。 在我的 conf 中设置 AllowOverride All 可以解决问题:)
【问题讨论】:
-
首先,您是否启用了
mod_rewrite?然后,您定义了一个RewriteBase,因此您不需要在index.php之前的第二个RewriteRule中使用前导斜杠。最后,在您的配置文件中将AllowOverride None更改为AllowOverride All -
在这种情况下,该域的 Apache 错误日志的输出也会有所帮助。此外,您可以打开日志记录以进行重写。 httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritelog 日志的输出可能会有所帮助 - 如果您自己无法弄清楚,请将日志的输出粘贴到问题中。
标签: php wordpress apache .htaccess