Source: www.php100.com
Custom jump instructions for Apache 404 error pages
The 404 error is actually a file error that we often see, but it is the default effect and is ugly.
Sometimes we need such a feature: we need to record what is the 404 page, and sometimes I need to determine whether the 404 page is a static page that should have been generated by the system but has not been successfully generated, if yes, we should generate this static page and then return the generated static page to the user.
The logic I want to handle is to jump the 404 error to a page named missing404.php.
Then implement the functions we need on this page.
First, define the jump: Use the following statement in the virtual site definition.
Errordocument 404 http://www.blogguy.cn/missing404.php
The virtual site after definition is as follows:
<Virtualhost *: 80>
Serveradmin wayswang@gmail.com
DocumentRoot/usr/local/Apache/htdocs/blogguy.cn
Servername www.blogguy.cn
Serveralias blogguy.cn
Errorlog logs/blogguy.cn _ err_log
Customlog logs/blogguy.cn-access_log2 common
Errordocument 404 http://www.blogguy.cn/missing404.php
<Ifmodule mod_limitipconn.c>
<Location/upimg/soft>
Maxconnperip 5
</Location>
</Ifmodule>
</Virtualhost>
Processing in missing404.php will be explained separately
Another method is provided here, but it is not recommended to use. htaccess to redirect resources.
Add in. htaccess
Errordocument 404/404 .html
You can find that the 404.html file is too small, and IE cannot find it. It is a 404 error. If the size of 404.html is smaller than 512 bytes, ie will deem this error page as not "friendly" and will ignore it.