我的htaccess中有一个index.php重定向规则,现在如果url包含index.php/anywhere,那么它应该显示错误页面,并显示404代码
我有以下配置的htaccess文件,其中我已将www.example.com/index.php重定向到www.example.com我的htaccess中有一个index.php重定向规则,现在如果url包含index.php/anywhere,那么它应该显示错误页面,并显示404代码,php,apache,.htaccess,redirect,mod-rewrite,Php,Apache,.htaccess,Redirect,Mod Rewrite,我有以下配置的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] Re
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]
但现在我有一些由谷歌网站管理员工具提供的URL,它们显示的是软404页面,所有的URL都包含index.php
i、 e.www.example.com/index.php/anything
我使使用htaccess显示404页面成为可能,但它并没有返回404响应代码。我想显示404页面以及作为回报的响应代码404