MENU service case
 Website construction website design Beijing website construction high-end website production company Shangpin China
We create by embracing change
360 ° brand value__
simplified Chinese character
Simplified Chinese English

Shangpin China Joins Hands with Beisheng Internet to Create a New Chapter in Website Construction

Type: Shangpin Dynamic Learn more

Website optimization knowledge: how to correctly set 404 pages

Source: Shangpin China | Type: website encyclopedia | Date: December 12, 2013
Many webmasters often check Website construction Whether there is a 404 page or not is generally judged by simply typing an incorrect link of the domain name in the search engine address bar, and then checking whether there is a 404 page. Is that right? The meaning of 404 page is to tell the viewer and the search engine that the requested page does not exist or the link is wrong. This check can only show that the user sees 404 page, but what about the search engine? Will the 404 status code be returned to this page?

Let's take a look at the following two pictures. The 404 page in your eyes may not return a 404 status code.

 Website optimization knowledge: how to correctly set 404 pages

harm

It can be seen that although the website returns 404 pages to users, it is a normal page for search engines. This is often due to the wrong server configuration, which leads to the return of the "200" status code. Although there is no difference between the HTTP status code of "404" and "200" for the visited users, it also improves the user experience, But for search engines, this is quite important, even fatal.

When the search engine spider receives a "404" status response when requesting an incorrect URL address, it knows that the URL address has expired, and will no longer index the page, and feedback to the data center that the page represented by the URL address is deleted from the index database. When the search engine receives a "200" status response to the 404 page, it will consider the URL address to be valid, It will be indexed and included in the index database, so that all your error pages for the search engine are pages with different URLs and the same content, which will lead to a large number of duplicate pages, which will greatly reduce the site quality rating, or even directly reduce the power.

Therefore, the correctly set custom 404 error page should not only display correctly, but also return the "404" error code instead of 200 or others. It is not only necessary to tell the user that the page does not exist, but also to correctly let the search engine know that this is a 404 error page rather than a normal page.

How to set 404 page correctly

1. 404 error page setting in ISS

Open IIS Manager -->click the properties of the website to set custom 404 -->click the custom error option -->select the 404 page -->select and open the edit property -->set it to a file or default value -->fill in "/404. html" in the URL, and press OK to exit. Then upload the 404.html page to the root directory of the website. You must select File or Default Value in Message Type instead of URL. Otherwise, a status code of 200 will be returned.

 404 error page setting in ISS

2. Setting 404 error pages under Apache is very simple. Generally, there is a 404 error page setting function. You only need to create a 404 page and upload it to the corresponding directory.

3. The space of some hosts returns 320 or 200 status codes by default. What should I do? We can solve this problem through the following code:

Set 404 error page under Apache Server

Create a. htaccess file, add the following content: ErrorDocument 404/notfound.php, then upload the. htaccess file to the root directory of the website, and finally create a 404 page named notfound.php, which must be consistent with the above name, and then upload it to the root directory of the website. Remember not to use an absolute URL here. If you use an absolute URL, the status code returned is 302 or 200.

IIS/asp。 Set 404 error page under. net

First, modify the settings of the application root directory, open the web.config file, and reference the following:

Error.asp is the default 404 page name, and notfound.asp is a user-defined 404 page. Please modify the corresponding file name when using.

Then, add the following code to the customized 404 page notfound.asp to ensure that the IIS server can correctly return the 404 status code.

<% Response. Status = 404 Not Found%>

In a word, the 404 page of the website must be set well. If the 200 status code is returned, it is asking for trouble. It is better not to do it. Marketing website construction After setting up the 404 page of Shangpin China, be sure to check whether it is correct. The returned page must be in 404 status. If your website generates more 404 pages of 200 yards, it will lead to a loss of authority, which is very tragic. In addition, when making 404 pages, we should also pay attention to the beauty and experience of the page. We should try not to automatically jump or just show that the page is inaccessible. 404 pages also need clear navigation so that users can decide where to go, so that they can stay.
Source Statement: This article is original or edited by Shangpin China's editors. If it needs to be reproduced, please indicate that it is from Shangpin China. The above contents (including pictures and words) are from the Internet. If there is any infringement, please contact us in time (010-60259772).
TAG label:

What if your website can increase the number of conversions and improve customer satisfaction?

Make an appointment with a professional consultant to communicate!

* Shangpin professional consultant will contact you as soon as possible

Disclaimer

Thank you very much for visiting our website. Please read all the terms of this statement carefully before you use this website.

1. Part of the content of this site comes from the network, and the copyright of some articles and pictures involved belongs to the original author. The reprint of this site is for everyone to learn and exchange, and should not be used for any commercial activities.

2. This website does not assume any form of loss or injury caused by users to themselves and others due to the use of these resources.

3. For issues not covered in this statement, please refer to relevant national laws and regulations. In case of conflict between this statement and national laws and regulations, the national laws and regulations shall prevail.

4. If it infringes your legitimate rights and interests, please contact us in time, and we will delete the relevant content at the first time!

Contact: 010-60259772
E-mail: [email protected]

Communicate with professional consultants now!

  • National Service Hotline

    400-700-4979

  • Beijing Service Hotline

    010-60259772

Please be assured to fill in the information protection
Online consultation

Disclaimer

Thank you very much for visiting our website. Please read all the terms of this statement carefully before you use this website.

1. Part of the content of this site comes from the network, and the copyright of some articles and pictures involved belongs to the original author. The reprint of this site is for everyone to learn and exchange, and should not be used for any commercial activities.

2. This website does not assume any form of loss or injury caused by users to themselves and others due to the use of these resources.

3. For issues not covered in this statement, please refer to relevant national laws and regulations. In case of conflict between this statement and national laws and regulations, the national laws and regulations shall prevail.

4. If it infringes your legitimate rights and interests, please contact us in time, and we will delete the relevant content at the first time!

Contact: 010-60259772
E-mail: [email protected]