繁体   English   中英

.htaccess不会重定向到自定义404页面

[英].htaccess does not redirects to custom 404 page

我目前正在自己​​的网站上运行,该网站在本地Apache服务器上运行。
file which is supposed to redirect 404 errors to a custom page. 我有一个文件,该文件应该将404错误重定向到自定义页面。
这里是:

ErrorDocument 404 /404.php

但是我得到的只是以下错误,而不是我的自定义404页面:

Not Found

The requested URL /my-site/gqehgr was not found on this server.

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

Apache/2.4.9 (Win32) PHP/5.5.12 Server at localhost Port 80

我在几个论坛上看到可以使用RewriteEngine,但我不知道它是如何工作的。
有人知道吗?

编辑:
该行应为:

ErrorDocument 404 /my-site/404.php

找不到您的404.php 检查文件。 尝试手动请求/404.php

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM