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

How to customize 404 and 503 pages through. htaccess

Source: Shangpin China | Type: website encyclopedia | Time: January 19, 2012

How to customize 404 and 503 pages through. htaccess

SEO website optimization 404, 503 Mistakenly believe most Beijing website construction The webmaster friends are very familiar with it. After the website has just been built, we usually make a 404 and 503 error page. So how does this work? My friends who are familiar with me will surely remember my article "A detailed explanation of Apache server 301 redirection" written a few days ago, Beijing website production That is to say, 301 redirection function is realized through. htaccess. So this time, the author also uses. htaccess to achieve. First of all, what are the 404 and 503 errors.

404:404 The return code means "NOT FOUND". The search engine will think that the web page has failed, and it will usually be deleted from the search results. In the short term, the spider will not crawl the url if it finds it again.

The 503:503 return code means "Service Unavailable". Search engines will think that the webpage is temporarily inaccessible, which usually happens when the website is temporarily closed and bandwidth is limited. For the 503 returned from the webpage, the spider will not delete the url directly, but will visit it again in a short time. If the web page has been restored at that time, it will be crawled normally; If you continue to return to 503, you will visit it several times in a short time. However, if the page returns 503 for a long time, the URL will still be considered as an invalid link by the search engine and deleted from the search results.

1、 The method to customize the 404 error page through. htaccess is as follows. First, create a new notepad locally, and enter the following code for the body content:
deny from all

ErrorDocument 404 /404.html
order deny,allow

Then save the file, rename it ". htaccess" and upload it to the location defined in the code. For example, the path of 404.html page in the above code is the root directory. One thing to note here is that files in the general local environment do not support the naming of ". htaccess", so you can change the file name after uploading the file via FTP.

2、 The method of customizing 503 error pages through. htaccess. Similar to the first one, create a new notepad and enter the following code ",

deny from all

ErrorDocument 503 /503.html
order deny,allow

Then save the corresponding path uploaded to the website via FTP.

Finally, give the novice webmasters a suggestion. When the website is temporarily closed, do not return to 404 immediately. It is better to use 503 status. 503 can tell the search engine spider that the page is temporarily inaccessible. Please try again after a while. In addition, if spiders have too much pressure to crawl your site, try not to use 404. It is also recommended to return 503. In this way, the search engine spider will try to crawl the link again after a period of time. If the site is free at that time, it will be successfully crawled.
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]