In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces how php returns the error code, the article is very detailed, has a certain reference value, interested friends must read it!
1. You can add 404 header information to the return page with the header () function.
2. Prompt the browser that the web page cannot be found.
So you can use:
Header ("HTTP/1.0 404 Not Found")
Or:
Header ("Status: 404 Not Found")
The latter is used in FastCGI mode, and two sentences can be written directly at the same time in php code.
The instructions for header are as follows:
The header string.There are two special-case header calls. The first is a header that starts with the string "HTTP/" (case is not significant), which will be used to figure out the HTTP status code to send. For example, if you have configured Apache to use a PHP script to handle requests for missing files (using the ErrorDocument directive), you may want to make sure that your script generates the proper status code.For FastCGI you must use the following for a 404 response:
And header ("Location: xxx.com"); the default is to do 302 state jump, so it can not output 404 error status to the browser.
The above is all the contents of the article "how php returns error codes". Thank you for reading! Hope to share the content to help you, more related knowledge, 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.