Returns the reasonable setting of the 404 error page

Source: Internet
Author: User
Tags iis

IIS default error page is very unfriendly, many people see the default error page will say: The site can not open! Loss of this part of the flow. And if the error page directly to the home page and search engine is very unfriendly, not good home will also be sealed off. So according to the situation, there are two ways to solve this problem:

1, if it is a blog and other content-type site, you can return a 404 error search box to let visitors search, if E-commerce site, you can return a 404 error progress bar to jump. Both of these methods take care of the visitors and consider the SEO.

2, can be in Google Webmaster tools to see how many of their own site error page.

The way to modify the default error page is simple: Right-click the Web site that you want to manage in IIS, and set 404 to the appropriate error message page in your custom error. There are two ways of doing this:

1, if the "message type" you selected is "file", you can only use the. html or HTM end of the file, otherwise the user access to the error page will appear code. The error page that is set in this way, although the. html file does not output a 404 state, IIS automatically outputs 404 states after execution.

2, if you "message type" selected "URL", you must use ASP files (because only in the ASP file to set the 404 state), otherwise access to the error page will return a 200 status code. Also add the following in the ASP file:

If you want to jump to the first page regularly, there are two ways to do it:

1, using the META tag of the refresh to jump

According to Google Chinese blog administrator, Yahoo on the use of this method to jump.

2. Use JS to jump

  

Personal feeling the use of JS method better, because meta tags jump worry search engine will be identified as "200" or "302" see this passage here:

Often see a custom 404 error page for many web sites to take the form of first displaying an error message and then using Meta Refresh to jump the page to the home page, Sitemap, or other similar page. Depending on how it is implemented, such 404 pages may return "200" status codes, or "302 temporary redirects", but either way, from an SEO technical standpoint, is not an appropriate choice.

We have talked about the status of "200", so what will the search engine do when the 404 page returns "302"? Theoretically, the "302" error, the search engine that the page is there, but temporarily changed the address, will still index the page, so that the same will appear similar to "200" status code when the duplicate text problem; Second, the mainstream search engine, which is represented by Google, is demanding more and more stringent application scope of 302 redirects, and this kind of improper use of the 302 redirect is a big risk.

Some points to watch on the Internet:

1, remember not to turn the 404 error to the homepage of the website, otherwise it may cause the homepage to disappear in the search engine.

2, remember not to use absolute URL, if the use of absolute URL to return the status code is "302" + "200".

3, in the "message type" must choose "File" or "Default value", instead of selecting "URL", it will result in the return of the "200" status code (this is not the same as my own test, I chose the relative URL, the end of the Firebug test results are 404)



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.