When we do a website, we often move or delete some pages, but these pages are already in the search engine results, and may still be in front of the line. The result is like this: on Google and on Baidu.
So the viewer sees this page:
This is the 404 page. The vast majority of people in this situation will use the browser "back" to other sites, so you may lose this part of the reader. But if you create a custom 404 page, that's a lot to save for those readers. Also makes you look more professional.
Like this 404 page. This is the site of a sub directory relocation. On this page, tell the reader to go to the place you specified.
It's not hard to create 404 pages. Of course, free space is generally not allowed to do so. First you need to find in the file directory. htaccess (There is a small point in front) file, if you do not have this file to take you need to use http://www.aliyun.com/zixun/aggregation/18444.html "" > The text editor creates one and then uploads it to the appropriate directory, and if you already have the file, just edit it.
The example above is only for subdirectories under a Web site, so the. htaccess file is placed in this subdirectory and, if it is for the entire site, it is placed under the root directory of the site.
This is to tell the Apache server to go to this specified page when the 404 error page appears.
Note: the "E" and "D" at the beginning of the sentence are uppercase, the middle "http://www.yoursite.com" is of course your domain name, "404" is empty a space before and after, "404_page.html" at the end of you can be arbitrarily named, For example: 404error.html,not_found.html and so on.
After you have written the. htaccess file, the next step is to create the page. This page should give readers a certain amount of information, including navigation, search, etc. The address of this page should be the same as the address in the. htaccess file.
Finally test: Enter a site does not exist to see if the browser is not loaded in this custom 404 pages?
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.