Solve the problem of HTTP status Jump return error page in ASP _ Application Tips

Source: Internet
Author: User

IIS default error page is very unfriendly, many people see the default error page will say: The site can not open! Lost this part of the flow in vain. 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:

If it is a blog and other content-type site, you can return a search box with 404 errors 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.

You can see how many error pages you have on your site in Google Webmaster tools.

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. Here are two different ways:

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:

Copy Code code as follows:
<%response.status = "404 Not Found"%>

If you want to jump to the home page regularly, there are also two kinds of methods

1, using the META tag of the refresh to jump

Copy Code code as follows:
<meta http-equiv= "Refresh" content= "3;url=http://www.jb51.net>

2. Use JS to jump

<script style= "Text/javascript" > 
settimeout ("Testtime ()", 2500); 
function Testtime () { 
location = "http://www.jb51.net/"; 
} 
</script>

Personally think 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, for the "302" error, the search engine that the page exists, but temporarily changed the address, will still index the page, so that the same will appear similar to the "200" status code when the duplicate text problem; The mainstream search engine, which is represented by Google, is increasingly demanding 302 redirects, and this kind of improper use of the 302 redirect is a big risk.

The above is the entire content of this article, I hope to help you learn, a better solution in the ASP HTTP status Jump return error page problem.

Related Article

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.