Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the reason for the 404 not found on the web page? How to solve it?

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

When browsing the web, we often encounter the phenomenon of 404 not found and cannot continue to visit, so what is the reason for the emergence of 404 not found on the web page? How to solve it? Let's take a look at it with Xiao Yun editor.

404 not found actually represents a 404 page. When a user is browsing a web page, it returns an error page because the server cannot provide information properly, or the server cannot respond and does not know why. The purpose is to tell the search engine that the page does not exist, no longer let the search engine crawler to continue to visit this page!

The main reasons why a web page triggers a 404 not found prompt are as follows:

1. The user entered the link address incorrectly, which caused IIS to prompt 404 not found.

2. The original page on the server has been deleted, which often occurs in large forums. In order to ensure the rational use of server resources, BBS forums will delete expired or very old information pages, resulting in 404 not found.

3. When users visit some forbidden foreign websites in China, there will be a phenomenon of 404 not found, which requires the use of a proxy server to browse normally.

An effective solution to the emergence of 404 not found on web pages:

1. When 404 not found is caused by the change of the content path of the web page, we can define the 404 error in IIS to point to a dynamic page and use 301 redirection to jump to a new address in the page, and the server returns the 301 status code.

2. Design a html file, point 404 to the html file, and the page will return the 404 status code. The specific steps are as follows:

Open the IIS Manager-- > Click the properties of the site you want to set custom 404-- > Click the Custom error option-- > Select and open the editing properties-- > set to URL-- > fill in "/ err404.html" in URL-- > click OK to exit and upload the finished err404.html page to the site root directory. Be sure to select "File" or "default value" in the message Type here, rather than "URL", otherwise it will result in a "200" status code returned.

3. Point 404 to a dynamic page

For example, error.asp, if not set up in the page, just return the HTML code of the prompt, which will cause the page to return 200 status code, which is incorrect, we can add the statement: Response.Status= "404 Not Found" after displaying the prompt content, so as to ensure that the page returns the 404 status code.

4. Set 404 error page under Apache

The way to set the error page for Apache Server is simple, just add the following to the .htaccess document, ErrorDocument 404 / notfound.php

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report