Redirection of HTTP 301,302,303,307 (RPM)(2012-12-11 11:55:04)
reproduced
| Tags: gossip |
Category: Network |
301 permanent redirection, which tells the client to be accessed from the new address later.
302 as the standard of HTTP1.0, formerly known as moved temporarily, is now called found. Now using only for compatibility processing, including PHP's default location redirection is also 302.
But HTTP 1.1 has 303 and 307 as a detailed supplement, in fact the refinement of 302
303: For a POST request, it indicates that the request has been processed and the client can then use the Get method to request the URI in the location.
307: For a POST request, the request has not been processed and the client should re-initiate the POST request to the URI in the location.
Actual test:
Test content:
Write a test test.html code that initiates a POST request to the test.php page
test.php page gives 3 kinds of redirection processing, all jump to test2.php
test2.php print out the results of the post
(as to how to write: Check your own manual, PHP send headers very easy.)
- ....
- 301 = "http/1.1 301 Moved Permanently",
- 302 = "http/1.1 302 Found",
- 303 = "http/1.1 303 See other",
- 307 = "http/1.1 307 temporary Redirect",
- ....
Test results:
301,302 and 303 of the processing results are the same, jump directly to test2.php,post no content
307 will re-post the request to test2.php and give the page hint
Source: http://leexj1981.blog.163.com/blog/static/14393065920103192952974/
Go: Links
Redirection of HTTP 301,302,303,307 (RPM)