views:

217

answers:

2

Firefox:
http://example.com/about/#anchor -> http://www.example.com/about/#anchor

Internet Explorer 6-8:
http://example.com/about/#anchor -> http://www.example.com/about/

Why is the anchor dropped in IE and what can I do about it? (Query string is not dropped, only the #xyz part)

Is a PHP header or javascript redirect my only option? Thanks for all hints.

Update: Seems as the hash is not sent to the server. Would combining a PHP 301 header and a javascript redirect (with the location.hash) be a good solution?

A: 

Had a similar problem in Tomcat/JSP, don't know about PHP. In Tomcat the rule was that the #anchor is only intended for the browser/user agent so you can't get it. My workaround was to use Javascript in the page instead to achieve the redirect. My tip would be that if you can't get it working in PHP soon then start trying a Javascript workaround.

james
A: 

Anchors are never sent to the server, so no server-side solution can retain them.

ceejayoz