Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/286.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/8/.htaccess/5.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
Php I';当加载一个不';不存在_Php_.htaccess_Mod Rewrite - Fatal编程技术网

Php I';当加载一个不';不存在

Php I';当加载一个不';不存在,php,.htaccess,mod-rewrite,Php,.htaccess,Mod Rewrite,我以为我把404设置为404.php,但我也把Mod_rewrite设置为drop.php,所以我在htaccess文件中删除了.php 这是我的 IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti* <Limit GET POST> order deny,allow deny from all allow from all </Limit> <Limit PUT DELETE> ord

我以为我把404设置为404.php,但我也把Mod_rewrite设置为drop.php,所以我在htaccess文件中删除了.php

这是我的

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST> order deny,allow deny from all allow from all </Limit> <Limit PUT DELETE> order deny,allow deny from all </Limit>

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) $1.php [L]

ErrorDocument 404 /404
IndexIgnore.htaccess*/.?****.\HEADER**/README**/\u vti*
订单拒绝,全部允许拒绝,全部允许订单拒绝,全部允许拒绝
重新启动发动机
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}-F
重写规则(.*)$1.php[L]
错误文件404/404
但是,如果加载一个随机页面名,它就不会再转到404.php


我哪里出错了?

错误文档404/404

应该是


errordocument404/404.php

检查Apache日志-它会说找不到文件“404”

重写引擎规则不适用于errordocument。

实际上我在这里找到了它。很抱歉浪费了一些空间,但我在最初的搜索中没有看到它。这解决了我的问题并解释了发生的事情。好东西!