What is 404 not found? How to solve 404 not found?

What is 404 not found? How to solve 404 not found?

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.
2. The original page on the server has been deleted. This situation 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 foreign websites that are prohibited from access in China, the 404 not found phenomenon will appear. This requires the use of a proxy server for normal browsing.

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?

Recommend

Stock Market Shilin April Practical Training Camp

Resources of Guhai Shilin April Practical Trainin...

Top 10 rules for short video operations to become a hit!

How to do short video marketing? Are there more w...

Second-hand mobile phones leak user privacy? It's not difficult to "fight back"

In recent days, a report from CCTV has made the p...

The beginning of the "fall" of the giant Sony after the marriage with Xiaomi

Although the domestic TV market has been dominate...

An article about ButterKnife to make the code more concise

Preface Android developers all know that each tim...

User Operations: Practical Training Camp to Increase Conversion Rate by 50%!

Nowadays, training camps have become one of the s...

Are you still afraid of chickens in your 30s? This is not hypocrisy

Audit expert: Yin Tielun Deputy Chief Physician, ...

This epidemic forces people to give up delicious food (not stomach problems)

Do you have friends like this around you? Are the...

10 questions for brands to start streaming on Douyin

These high-frequency questions almost list all th...

Congratulations! It’s the first anniversary of Chang’e 5’s launch!

Today is November 24th One year ago today, China&...