标题("location:/?param = abc"); 包含有效参数并与所有浏览器兼容?

Har*_*iec 1 php url location header http

a是否header("location: /?param=abc");包含有效参数并且与所有浏览器兼容?或者,文件的url是必须的,因此它应该包含文件的路径:

header("location: /index.php?param=abc");
Run Code Online (Sandbox Code Playgroud)

hak*_*kre 5

不,它不是所有HTTP客户端的兼容性,因为HTTP需要Location标头的有效URI(绝对,而不是相对).

有关规范要求,请参阅RFC 2616 14.30位置.