In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
In this issue, the editor will bring you about the virtual host does not display 404 pages, the article is rich in content and professional analysis and description for you, after reading this article, I hope you can get something.
In the construction of web pages on the virtual host, sometimes we often encounter the phenomenon that 404 does not display and cannot continue to visit, so what is the reason why the web page appears 404 not found and how to solve it? let's take a look at it together.
Web page 404 not found
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 goal is to tell the search engine that the page does not exist and no longer allow the search engine crawler to continue to visit the page.
The reason why the web page triggers 404
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.
The solution to the appearance of 404 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 website you want to set custom 404-Click the Custom error option-Select and open the editing properties-set to URL-URL fill in "/ err404.html"-press OK to exit, and then upload the finished err404.html page to the virtual space root directory.
Be sure to select "File" or "default" in the message Type instead of "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 website space page returns the 404 status code.
4. Set 404 error page under Apache
The way to set up the error page for Apache Server is as simple as adding the following to the .htaccess file, ErrorDocument 404 / notfound.php.
The above is the virtual host shared by Xiaobian does not display 404 pages, if you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.