我刚刚添加了大量 301 重定向,除了包含 PHP 扩展的重定向外,其他所有重定向都有效。例如,/gallery/ 重定向正常,/brochure.pdf 也是如此,但 /sitemap.php 或任何其他以 .php 结尾的 URL 均不会重定向。
我假设它一定与服务器有关,但不确定在哪里查找。
我正在使用 Ubuntu 20.04、PHP 7.4、NGINX 1.18.0
有人能给我指出正确的方向吗?
.htaccess 内容
# BEGIN iThemes Security - Do not modify or remove this line
# iThemes Security Config Details: 2
# Pass through Authorization header.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
</IfModule>
# END iThemes Security - Do not modify or remove this line
# 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.
<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