Question

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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top