Forum Moderators: phranque

Message Too Old, No Replies

301 redirect - Internet Explorer doesn't play well with # in urll

         

hexed

11:16 am on Mar 21, 2014 (gmt 0)

10+ Year Member



Hi, I've set up some 301 redirects in .htaccess for a client

This is an example of the format:

Redirect /services/service-a http://www.example.com/new-services#section-a

Works fine, page jumps to correct section on all browsers except Internet Explorer which completely ignored the hash (it's removed from the URL completely in IE).

Any known cure for this?

[edited by: bill at 2:50 am (utc) on Mar 22, 2014]
[edit reason] use EXAMPLE.com [/edit]

g1smd

8:02 pm on Mar 21, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The # is an in-page reference used internally within the browser, and is not part of the GET request.

Some browsers may offer non-standard behaviour in 'remembering' it.


Use example.com in code excerpts in this forum.

lucy24

9:20 pm on Mar 21, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Any known cure for this?

Are you really doing this in mod_alias (Redirect by that name)? If you express it as a RewriteRule-- meaning that all your other redirects also have to be converted-- you can append the [NE] flag. Then at least you know that the # is reaching the browser as intended, rather than coming through as %23. A browser can pretend that it has no idea what %23 means; with # it has no excuse.

hexed

11:38 am on Mar 26, 2014 (gmt 0)

10+ Year Member



Thanks for your help guys (&gals) . Lucy - thanks, I'll give this a go!