我的htaccess文件具有以下配置,我已将www.example.com/index.php重定向到www.example.com
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php/ /error-404 [P]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [L,QSA]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s(.*)/index\.php [NC]
但是现在我有一些由Google网站管理员工具提供的网址,它们显示的是软404页面,所有网址都包含index.php
即。 www.example.com/index.php/anything
我可以使用htaccess显示404页面,但它没有返回404响应代码。我想显示404页面以及响应代码404作为回报。