Safari ignoring/removing anchors (or “hashtags”) when clicking hyperlinks?

前端 未结 5 1503
遇见更好的自我
遇见更好的自我 2020-12-15 18:28

I need to point one page to another and then scroll to a particular section. In Chrome and Firefox, using an URL like www.example.com#section1 does the trick. (

5条回答
  •  伪装坚强ぢ
    2020-12-15 18:53

    I just experienced an issue like this. I was using a url re-write in the asp.net web.config. When Safari the hash and everything after was removed. After trying some of the things mentioned above I was still having problems. The issue for me was that this was all happening under HTTPS. Once I specified the full URL in the redirect and included the https:// scheme the redirect worked correctly and preserved the hash. Note this wasn't an issue with Chrome or Firefox.

提交回复
热议问题