Friday, 14 December 2012

Anchors lost on Safari when rewriting from https to http

Had an annoying problem today that I couldn't find a fix for. We have some rewrite rules that take care of enforcing which pages should be served over https and which over http. We have a link from one of the secure pages to an anchor (#myanchor) on an unsecured page.

Safari strips the anchor from the end of the URL when navigating this link. It forgets it was ever requested, presumably because the change from https to http is actually seen as a fundamentally different URL. I'm sure this is a Safari bug but intend to do a bit more digging when I have a moment, and my MBP at hand, and am not limited to working on an iPhone.

My hacky fix was to allow this unsecured page in particular to be served over HTTPS.

No comments:

Post a Comment

Comments are moderated, so you'll have to wait a little bit before they appear!