Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/227.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我的htaccess中有一个index.php重定向规则,现在如果url包含index.php/anywhere,那么它应该显示错误页面,并显示404代码_Php_Apache_.htaccess_Redirect_Mod Rewrite - Fatal编程技术网

我的htaccess中有一个index.php重定向规则,现在如果url包含index.php/anywhere,那么它应该显示错误页面,并显示404代码

我的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

我有以下配置的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]
但现在我有一些由谷歌网站管理员工具提供的URL,它们显示的是软404页面,所有的URL都包含index.php

i、 e.
www.example.com/index.php/anything

我使使用htaccess显示404页面成为可能,但它并没有返回404响应代码。我想显示404页面以及作为回报的响应代码404