简体   繁体   中英

HTTP headers difference (PHP)

Need some help understanding what the difference between these two redirects is:

header( "HTTP/1.1 307 Temporary Redirect" );
header( "Location: http://www.someurl.com/" );

Or

header( "Location: http://www.someurl.com/" );

What happens in the second case with the HTTP header? is there any set by default or is that wrong if I want to temporarily redirect something?

Is the second one wrong or is there no actual difference in the two? Can't find any documentation on what HTTP header is sent by default if I only use "Location".

Thanks in advance

From the manual :

The second special case is the Location: header. Not only does it send this header back to the browser, but it also returns a REDIRECT (302) status code to the browser unless the 201 or a 3xx status code has already been set.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM