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?
Author: Li Cunpu, Associate Professor, College of...
Pancreatic cancer, a malignant disease originatin...
The film "In the Octagonal Cage" tells ...
Luo Yuan's "Ukulele Lessons You Can Lear...
1. What is information flow advertising ? TA is a...
During the recent May Day holiday, the shoes of &...
Whether it is online e-commerce or offline stores...
Produced by: Science Popularization China Author:...
The famous thinker and philosopher Bacon once sai...
Artificial intelligence has been popular all over...
Dear developers, The wonderful stories of each de...
Compared with the requirements for other types of...
In China, 7-seat SUVs are not very popular among ...
Author: Song Qin, deputy chief physician of the D...
On the morning of September 17, QQ unblocked the ...