Site 404 Error Page Setup method

Source: Internet
Author: User

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

Last month, a friend gave me a million net of space, so decided to put the blog to a separate space to go, the original use of the link address is http://www.521yy.com/blog this, in the two level of the status of the directory, the replacement is now http://www.senlon.net this. Although 521yy this long ago for some reason by that mjj Baidu K, but also included in the normal Google, so after the move will lead to Google included in the link to a problem, some pages can not visit. This plan is to keep two, but looking at the upset, and finally the 521yy inside of the blog to delete.

Generally speaking, when the Web page URL address changed, the page file name or move location, import link spelling errors, etc., will cause the original URL address can not be accessed; When a Web server receives a similar request, it returns a 404 status code telling the browser that the resource being requested does not exist. However, the default 404 error pages of the Web server, both Apache and IIS, are simple, inflexible, and unfriendly to the user, unable to provide the user with the necessary information to get more clues, which will undoubtedly result in the loss of the user.

When a search engine gets a bad link, the site should return a 404 status code, telling the search engine to discard the index on the link. If you return a 200 or 302 status code, the search engine will index the link, which leads to a large number of different links pointing to the same page content. As a result, search engines have significantly reduced their trust in the site. So, after the custom 404 error page is set up, be sure to check to see if it can correctly return the "404" Status Code. Check the method is also quite simple, enter a Web site does not exist in the URL, look at the return of the HTTP header, make sure it returns a "404" Status Code.

404 error settings can be directly to the virtual space in the control panel of the "Error customization", I believe that the vast majority of the space vendors are supporting 404 settings.

and PHP as long as in the. htaccess to modify it:

In the. htaccess file add: ErrorDocument 404/notfound.html

Create a 404 page name notfound.html and place it in the root directory of your site.

If you need to set the 404 error page under Iis/asp.net, first edit the application root Web.config and add the following:

<configuration>
<system.web>
<customerrors mode= "on" defaultredirect= "error.asp" >
<error statuscode= "404″redirect=" notfound.asp "/>
</customErrors>
</system.web>
</configuration>

(Note: The above "error.asp" is the default 404 page of the system, "notfound.asp" is a custom 404 page, please modify the corresponding file name when using)

Then, add the following content to the custom 404 page "notfound.asp":

<%
Response.Status = "404 Not Found"
%>

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.