The default error page of iis is very unfriendly. Many people will say when they see the default error page: The website cannot be opened! This part of the traffic was lost in vain. If the error page jumps directly to the homepage and is not friendly to search engines, the homepage may be blocked. So depending on the situation, there are two ways to solve this problem:
If it is a content-type website such as a blog, you can return a search box with 404 errors for visitors to search. If it is an e-commerce website, you can return a progress bar with 404 errors for jump. These two methods take care of visitors and take into account SEO.
You can check how many error pages of your website are in Google webmaster tools.
The method to modify the default error page is very simple: right-click the website you want to manage in IIS, and set 404 as the corresponding error information page in the custom error. Here are two ways:
1. If you choose a file for the message type, you can only use files ending with .html or htm, otherwise the code will appear when the user accesses the error page. In the error page set in this way, although the 404 status is not output in the .html file, the 404 status will be output automatically after the IIS is executed.
2. If you select url for the message type, you must use the asp file (because the 404 status can only be set in the asp file), otherwise 200 status code will be returned when accessing the error page. Also add:
<%response.status = 404 not found %>
If you want to jump to the homepage regularly, there are two ways:
1. Use the refresh of the meta tag to jump
<meta http-equiv=refresh content=3;url=http://chenfangyi.com/?xxx>
According to the Google Chinese blog administrator, yahoo jumps to this method used.
2. Use js to jump
I feel that using js is better because meta tag jumps are worried that search engines will recognize as 200 or 302 See this passage here:
I often see that many websites have custom 404 error pages in a similar form: first display an error message, and then, through meta refresh, the page will be redirected to the homepage, webpage map or other similar pages. Depending on the specific implementation method, this type of 404 page may return a 200 status code or a 302 temporary redirect, but no matter which one, from the perspective of SEO technology, it is not a suitable choice.
We have already talked about the 200 status above. So, when the 404 page returns to 302, what will the search engine deal with? Theoretically, for the 302 error, search engines believe that the web page exists, but the address is temporarily changed, and the page will still be indexed and included. In this way, duplicate text problems similar to those of the 200 status code will also occur; secondly, mainstream search engines represented by Google have increasingly strict requirements on the scope of application of 302 redirection, and this kind of improper use of 302 redirection poses great risks.