header Location redirect with anchor tag and IE7

后端 未结 2 1822
野的像风
野的像风 2021-01-26 00:45

Hey there! Here is my issue, it could just be a browser issue but any help/ideas would be awesome!

Pretty much I have the following redirect:

header(\"Lo         


        
相关标签:
2条回答
  • 2021-01-26 01:16

    The Location header requires an absolute path per the HTTP specification. Try using an absolute path. The errata says that document fragments (#id) are allowed in the Location header, but the behaviour when a user is linked to a page with a fragment (e.g. http://example.org/a_redirector#this where a_redirector redirects to http://example.com/destination#that) is undefined.

    0 讨论(0)
  • Yes that is true. It can be prevented if you use an absolute path:

    header("Location: http://www.example.com/page.php#images");
    
    0 讨论(0)
提交回复
热议问题