IIS custom 404 page return 200 status code severity and resolution _win server

Source: Internet
Author: User

Before you get to 404 pages, let's get a look at some common HTTP status codes.
* 404: The requested Web page does not exist (does not exclude the possibility that the link will be valid later);
* 410: The requested Web page does not exist (permanent);
* 200: The server successfully returned to the Web page
* 302: URL temporary redirect (jump)
* 301: Permanent Site redirection
* 403: Access Denied
* 500: Internal Error

When accessing a nonexistent page, it returns a 404 status code, telling the search engine that the page does not exist or has been deleted.
By default, when you do not customize 404 pages, accessing a nonexistent page is shown in the following image

The appearance of such a page is very unfriendly to both the user and the search engine.
Here we will make a custom error page, as shown in the following illustration:



There are several benefits to such a 404 page:
One, you can prompt visitors to visit the page does not exist, rather than let visitors see a wrong hint
Second, can guide visitors to browse other pages, reduce the bounce rate

Now are you excited about the effect?

Wait a minute, do 404 pages to check the status code of 404 pages, is it really return 404, or 200?
You can detect the status code in this address http://www.seobox.org/getheader.htm, enter your site on a non-existent page, see his return status code is what?
For example, I will test the 404 status code on the website of Shuo-research technology, the result is as follows:



You can see that the status code returned when we visited the nonexistent page of HTTP://WWW.SHUOYAN.NET/FDSFSDF is 404. That's what we're going to do.
If you do a custom error page, using the above tools to detect your error page return is 200 status code, you must contact the space business to make changes, otherwise the consequences are very serious.

If your virtual host is IIS, there are two ways to set 404 as the appropriate error message page in IIS:

1, if the "message type" you selected is "file", you can only use the. html or HTM end of the file, IIS will automatically output 404 states.

Message type Select the file, then click Browse in the file and select your custom error page. As shown in the following illustration:

Custom error page settings

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.

You can ask the space trader to set it up.
What happens if the Web site's Custom 404 error page does not return a "404" status code instead of a "200" when the URL is invalid? It is obvious that the search engine will think that the "non-existent" Web page exists within the site, which will lead to many problems, affecting the ultimate SEO effect of the site.

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.