Teach you to set up and beautify 404 pages correctly

Source: Internet
Author: User

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

When some pages of your site are inaccessible, the site often returns 404 status, which shows 404 pages. So, what is 404 page. So, what is 404? 404 the Meaning of the page is that the page is temporarily inaccessible. Because of a variety of external, internal reasons, the site will always have temporarily inaccessible or has expired pages, when the browser would display a "page can not find" page, that is, 404 pages, but usually the system comes with 404 pages not only very beautiful, but also difficult to retain users. Therefore, we need to make a custom "404" page.

However, many people customize the 404 page although beautiful, but the page return status is "200", that is, the page normal access. and "200" page will be indexed by the normal search engine, which will cause a lot of page duplication, and thus be down right. So how do you know if your 404 page settings are correct? It's simple, just search for "404 status Checks" To find lots of online test 404 sites. If you know the 404 page Setup problem, how to change it? Just pay attention to 2 o'clock:

1. You must not jump directly to the home page. Many sites like to add jump code in 404 pages, so the search engine is very unfriendly, it is likely to be down the right, and even be sentenced to cheating.

2. Add a 404 state return code to the page header. The code is as follows: PHP page: PHP

Header ("http/1.1 404 Not Found");? > ASP page: ASP

OK, so the next right 404 page is set up. The next step is landscaping. The best way to beautify a novice with poor foundation is to learn from other websites.

For example, my site is using the QQ Dictionary of 404 pages. Just look at the source code and change the key place. But note that. Page header to add the previously mentioned return status code, otherwise it will become 200 pages. Here, I give you a suggestion: in order to ensure the coordination of the entire site, 404 pages are best to use the head of other pages of the site. But this may require the use of 2 css (for use div web site), easy to create confusion. The workaround is simple, and you can add the CSS code before you need to invoke the part of the CSS.

Set, beautify 404 pages, upload to the server or virtual host root directory and set it. This article from: http://www.wuliao5.com reprint please keep the link, thank you!

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.