简体   繁体   English

HTTP标头差异(PHP)

[英]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? 在第二种情况下使用HTTP标头会发生什么? 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". 如果仅使用“位置”,则找不到有关默认发送的HTTP标头的任何文档。

Thanks in advance 提前致谢

From the manual : 手册

The second special case is the Location: header. 第二个特殊情况是Location:标头。 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. 它将不仅将此标头发送回浏览器,而且还向浏览器返回REDIRECT(302)状态代码,除非已经设置了201或3xx状态代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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