apache Mod_rewrite 关闭,wordpress 高兴,404 我不高兴
-
12-11-2019 - |
题
我已经摆弄 mod_rewrite 一段时间了,但它已经让我变得最好了。希望这里的任何人都能阐明我的问题。
我正在尝试自行托管 WordPress,当我在网站的 .htaccess 文件中将 mod_rewrite 设置为关闭时,它效果很好。但如果我将其打开,则会出现禁止错误。日志显示:
选项 FollowSymLinks 或 SymLinksIfOwnerMatch 已关闭,这意味着禁止 RewriteRule 指令:/c/blog/wp-admin/index.php,引用: http://xxx.xxx.xxx.xxx/blog/wp-admin/options-permalink.php
.htaccess 包含
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
# END WordPress
提前致谢!
解决方案 3
显然存在一个Quirk,托管WordPress在ReadyNA上,在那里.htaccess文件只是使其成为B0RK。解决方案是将选项索引从Interning索引从/etc/frontview/apache/shares.conf中的选项更改为选项.CONF
其他提示
检查并确保您的 Apache 用户(wwwuser
或者 webserv
?) 可以阅读 .htaccess
在根文件夹中。
为了使这变得非常简单,您只需使文件全局可读和可写(chmod 777
) 但 请确定 稍后将其恢复为更正常的 755。
如果您发现这是您的错误,请检查 user:group
在 .htaccess
(ls -la .htaccess
应该可以解决问题)并确保它与您的其他文件匹配。
看起来像Apache Config中的东西是禁止“Rewriteule”行?日志输出建议您可能需要打开PromotSymlinks或Symlinksifownermatch