我真的可以在这里帮忙。通过测试,我知道这是一个WordPress问题。如果我允许.htaccess通过将AllowOverride FileInfo
添加到https conf文件来处理在Wordpress站点上的重写,则由于根URL没有默认索引页,所以D0
站点都重定向到AlmaLinux默认页面。如果我不允许它处理.htaccess,它可以工作,但是我需要使用.htaccess,What在这里运行吗?
下面是我的WordPress站点.htaccess
文件,如果我取消注释AllowOverride FileInfo
,然后将所有内容重定向到AlmaLinux默认页面,就会破坏WordPress。这是由WordPress自己创建的
# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
谢谢你能帮我解决这件事。
发布于 2023-03-29 22:42:40
修正了,我应该首先查看Apache错误日志。我刚发现:
[Wed Mar 29 23:17:59.234743 2023] [rewrite:error] [pid 133333:tid 133444] [client 81.11.11.11:53583] AH00670: Options FollowSymLinks and SymLinksIfOwnerMatch are both off, so the RewriteRule directive is also forbidden due to its similar ability to circumvent directory restrictions : /var/www/www.mysite.com/
搜索我们看到的错误:如果您的服务器同时关闭了FollowSymLinks和SymLinksIfOwnerMatch,那么重写规则将停止工作。
就这么简单!
因此,我浏览了Apache文件中的所有站点,并将:Options None
改为:Options SymLinksIfOwnerMatch
固定
https://serverfault.com/questions/1127378
复制相似问题