[英].htaccess does not redirects to custom 404 page
I'm currently working on my own website which runs on an local Apache Server. 我目前正在自己的网站上运行,该网站在本地Apache服务器上运行。
I have a .htaccess file which is supposed to redirect 404 errors to a custom page. 我有一个.htaccess文件,该文件应该将404错误重定向到自定义页面。
Here it is: 这里是:
ErrorDocument 404 /404.php
But all I get is the following error instead of my custom 404 page: 但是我得到的只是以下错误,而不是我的自定义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
I saw on several forums that I could use the RewriteEngine but I don't understand how it works. 我在几个论坛上看到可以使用RewriteEngine,但我不知道它是如何工作的。
Does anybody have a clue? 有人知道吗?
EDIT: 编辑:
The line should be: 该行应为:
ErrorDocument 404 /my-site/404.php
Your 404.php
can not be found. 找不到您的404.php
。 Check your files. 检查文件。 Try to request /404.php
manually. 尝试手动请求/404.php
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.