From: http://developer.51cto.com/art/200908/141782.htm
ASP. NET configuration error pages may face many problems during website operation, such as server errors and the page requested by the user does not exist,ProgramConfiguration errors and other issues. Some default system error pages will appear when a user requests to browse the webpage. This is unfriendly to the user and unfriendly to the search engine.
Here we know some common HTTP status codes for Seo:
◆ 404: the server cannot find the specified resource and the requested webpage does not exist (for example, the webpage requested by the browser is deleted or moved, but it does not rule out the possibility that the link will be valid in the future );
◆ 410: the requested webpage does not exist (Note: 410 indicates permanent, and 404 indicates temporary );
◆ 200: the server returns the requested webpage successfully;
◆ 301: Permanent website redirection
◆ 302: temporary website redirection
In the search engine's view, the most important error is the 404 error, which indicates that the webpage does not exist. When a user enters the next page of your domain name that does not exist, the search engine determines that the HTTP Error does not exist. If there are too many such errors, the search engine will be punished.
ASP. NET configuration error page solution:
You can set the 404 page in IIS.
But. Net has this better practice. In the system. web of Web. config, you only need to add
- <Customerrors defaultredirect =& Quot; 404. aspx & quot"Mode ="On">
-
- <Error statuscode ="404"Redirect =& Quot; 404. aspx & quot"/>
-
- </Customerrors>
This can be written in ASP. net3.5.
- <Customerrors defaultredirect =& Quot; 404. aspx & quot"Redirectmode ="Responserewrite"Mode ="On">
-
- <Error statuscode ="404"Redirect =& Quot; 404. aspx & quot"/>
-
- </Customerrors>
If the redirectmode attribute is set to responseredirect, the user is redirected to the error page and the original URL is changed to the URL of the error page. If the redirectmode attribute is set to responserewrite, the user is directed to the error page without changing the original URL in the browser.
In this way, you can customize your own ASP. NET configuration error page.
The relevant operations on the ASP. NET configuration error page are introduced here. We hope to introduce you to the specific operations on the ASP. NET configuration error page.