Welcome to WebmasterWorld Guest from 54.144.57.183

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

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

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

New User

joined:Nov 28, 2012
posts: 6
votes: 0


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]

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

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


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.
9:20 pm on Mar 21, 2014 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:14253
votes: 551


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.
11:38 am on Mar 26, 2014 (gmt 0)

New User

joined:Nov 28, 2012
posts: 6
votes: 0


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

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members