For many novice website builders, when building a website, a 404 not found error suddenly appears. After a long time, they still have no idea what the problem is. Editor Feng Chao also encountered this problem when he was building a website before, but he solved it by consulting the information. Today, a friend suddenly asked me how to deal with the 404 not found error on the website? Let me review it again, what is 404 not found? How to solve 404 not found? Let’s take a look with Feng Chao from Dongguan Website Construction today! What is 404 not found? 404 not found actually represents a 404 page. When a user is browsing a web page, the server cannot provide information normally, or the server cannot respond and the reason is unknown, so an error page is returned. The purpose is to tell the search engine that the page does not exist and no longer allow search engine crawlers to continue accessing this page! Why does 404 not found appear? There are several reasons why 404 not found is triggered: 1. The user enters the wrong link address, causing IIS to prompt 404 not found. How to solve 404 not found? 1. When a 404 not found error occurs due to a change in the web page content path, we can define a 404 error in IIS to point to a dynamic page, and use a 301 redirect in the page to jump to the new address. At this time, the server returns a 301 status code. 2. Design an HTML file and point 404 to the HTML file. The page will return a 404 status code. Open IIS Manager-->Click the properties of the website for which you want to set a custom 404-->Click the Custom Error option-->Select the 404 page-->Select and open the edit properties-->Set to URL-->Fill in "/err404.html" in the URL-->Click OK to exit and then upload the err404.html page to the root directory of the website. Here, in "Message Type", be sure to select "File" or "Default Value" instead of "URL", otherwise, a "200" status code will be returned. 3. Direct 404 to a dynamic page For example, if error.asp is not set in the page and only the HTML code of the prompt is returned, the page will return a 200 status code, which is incorrect. We can add the statement: Response.Status="404 Not Found" after displaying the prompt content to ensure that the page returns a 404 status code. 4. Set up 404 error page under Apache The method of setting a 404 error page for Apache Server is very simple. Just add the following content to the .htaccess file: ErrorDocument 404 /notfound.php People who read this article also read: What are dead links? How to deal with dead links on the website? What are some common problems you may encounter in website maps? What is a wheel chain? What is the function of the wheel chain? |
<<: What is a wheel chain? What is the function of the wheel chain?
>>: How to analyze if a website is penalized by Baidu?
The total number of active users on Kuaishou and ...
Despite the rising cost of acquiring customers, I...
Are your members really your members? Regarding a...
The mini program provides convenience for publici...
Since the beginning of spring 2018, various inter...
Foreign trade Google optimization, how to conduct...
In order to better penetrate into various industr...
The Douyin Assistant is in the Douyin APP. The wa...
Introduction: In today's mobile era, short vi...
Today, editor Feng Chao will explain to you how t...
As Meituan Takeout has become the dominant player...
A small content topic basically has the following...
Recently, many advertisers have been wondering ab...
2017 is still a period of rapid development for i...
Topic marketing and event marketing are unfathoma...