Webpage tip: 404 not found what to do?

Why does 404 not found appear? 404 not found is triggered for the following reasons:

1. The IIS prompt 404 not found is caused by the user's incorrect input of the link address.

2. The original pages on the server are deleted. This often happens in large forums. In order to ensure the rational use of server resources, BBS forums will delete expired or very long-standing information pages, resulting in 404 not found.

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

404 not found?

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

2. Design an HTML file, and finally point 404 to the HTML file. At this time, the page will return 404 status code

Open IIS Manager -- > click the properties of the website to set 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 -- > press OK to exit and then finish the completed err404 Upload the 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, the "200" status code will be returned.

3. Point 404 to a dynamic page

For example, error ASP, if it is not set in the page, only the HTML code of the prompt will be returned, which will cause the page to return 200 status code. This is incorrect. We can add the statement: response after displaying the prompt content Status = "404 not found", which ensures that the page returns 404 status code.

4. Set 404 error page under Apache

The method of setting up 404 error page for Apache server is very simple, just in Add the following contents to the htaccess file, ErrorDocument 404 / notfound php