Avoid dead links and teach you to make 404 error pages (transfer)

Hope this article can be helpful for those who are newbie friends.

  Dead links are those links that are invalid and cannot be opened. There are dead links in many sites, especially those sites that have been redesigned. The pages that were previously included in the search cannot be opened now, and the dead links have a great impact on the website.

  Dead links are very unfriendly to search engines. When spiders crawl on dead links, there will be no exit links to crawl out. In this way, the website will not be liked by search engines, the website weight will be reduced, and it will not get a good ranking.

  For users, the existence of dead links is not good for user experience, and if there are too many, it will reduce user loyalty.

  The best and easiest way is to make a 404 error page in your website.

  The 404 error page is equivalent to a navigation, but if the user clicks or the search engine crawls a dead link, a link can lead back to other normal pages. Although this is a small detail, it is actually quite important for SEO.

  Then how to make a 404 page? Let me take my breast network as an example to explain how to make a 404 page.

  1 Create a .htaccess file and write a simple code like "ErrorDocument 404 /404.htm DirectoryIndex 404.htm" in it.

  2 Create a new 404.htm file. Note the .htm files, not .html. The two are still somewhat different. The first time I did it was to use .html and it never worked out. Then do a link navigation in your .htm file. It is to make a link so that users or spiders can click to enter the normal page, usually a link to the home page. My site made a very simple 404.htm file. For those who don't understand, you can go to my mammary website www.ahrxw.com and then add 404.htm to see the effect.

  3 Upload the created .htaccess file and 404.htm file to the root directory of the website.

  4 The last step, go to your virtual host to set up a custom error page. Choose to use the 404.htm file in the web directory to customize the content.

  In this way, friends who use virtual hosts have created a 404 error page. It's easy to do 404 with a friend of the server. You don't need to build a .htaccess file. Just make a 404.hml file and transfer it to the root directory, and then set the error page in the IIS traffic.

  Website optimization is a meticulous job, I hope you will stick to it for a long time!

 

Original link:--- click to send ---

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326871671&siteId=291194637