Redirection of HTTP 301,302,303,307

Source: Internet
Author: User

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.)

    1. ....
    2. 301 = "http/1.1 301 Moved Permanently",
    3. 302 = "http/1.1 302 Found",
    4. 303 = "http/1.1 303 See other",
    5. 307 = "http/1.1 307 temporary Redirect",
    6. ....

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.