当为ErrorDocument 404调用.html文件时,它起作用;当为ErrorDocument 404调用.php文件时,它不起作用

时间:2019-05-26 17:32:42

标签: php .htaccess http-status-code-404

因此,我在文件夹内以.htaccess结尾的文件,并且同时包含notfound.htmlnotfound.php文件。当我写

RewriteEngine on
ErrorDocument 404 /notfound.html

它确实包含该文件,但是当我打电话时

RewriteEngine on
ErrorDocument 404 /notfound.php

它不起作用。 当我调用一个我不知道的页面时,这就是我在WAMP本地主机网站上看到的:

The requested URL /leaderboard22.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

有人可以告诉我我在做什么错吗?

编辑:我只是将.html替换为.php,如果在更改文件类型之前可以使用该路径,则该路径完全可以。

0 个答案:

没有答案