Setting the 404 error page for Apache Server is simple. You only need to add the following content to the. htaccess file:
The code is as follows: |
Copy code |
ErrorDocument 404/notfound. php |
Note:
1. Do not redirect the 404 error to the website homepage. Otherwise, the homepage may disappear in the search engine.
2. Do not use an absolute URL (for example, http://www.111cn.net/nokia/n96/form). If you use an absolute URL, the returned status code is "302" + "200" (tested)
The correct method is to add in. htaccess
The code is as follows: |
Copy code |
ErrorDocument 404/404 .html |
Instead
The code is as follows: |
Copy code |
ErrorDocument 404 http://www.xxx.com/404.html |
The former returns a 404 status code,
The latter returns a 200 status code. If the content of a 404 page is smaller than 404 B, IE considers the 404 page unfriendly and will not return the error page in IE.
In summary, if another friend is using an absolute path for 404, immediately modify it. Otherwise, your return status is 200, these are only about apache 404 page settings in iis. Remember to set them to a relative path when setting them. Otherwise, the system will return the 200 status code instead of the 404 code, I have done something wrong before, and everyone knows the result.