2

Currently I have a rule that doesn't seem to work and I am wondering if I can use html anchors # to redirect users

<match url="^article\/article\.aspx$" />
    <action type="Redirect" url="http://www.abc.com" />
    <conditions>
        <add input="{QUERY_STRING}" pattern="#24" />
    </conditions>
PeanutsMonkey
  • 6,919
  • 23
  • 73
  • 103

1 Answers1

3

Hash Tags in the URL serve a special purpose to the client browser, not to the server. That means that a browser will NOT actually send anything after a '#' character to the server. So: if you request http://someurl.com/index.aspx#something, the server only sees http://someurl.com/index.aspx

Mike Richards
  • 5,557
  • 3
  • 28
  • 34
  • Thanks. If the link has been cached on Google and I need to redirect the user to a specific section of the website how do I achieve that keeping in mind that `#` serves a specail purpose to browsers? – PeanutsMonkey Aug 01 '11 at 02:10
  • Then you will probably have to handle that with javascript that executes on document ready. Javascript can see the whole url, hashtags included. – Mike Richards Aug 01 '11 at 02:12
  • Unfortunately we don't have any control over the application and can't include a javascript to handle it. Is there any other way? – PeanutsMonkey Aug 01 '11 at 02:37
  • I'm guessing you want to maintain those google links and not get rid of them? Unfortunately, I don't think there's an easy solution for that, unless you can redirect the user to an application you do have control of, and have that page redirect or do whatever you need it to do – Mike Richards Aug 01 '11 at 02:48
  • We don't want to get rid of them but would like to redirect users to another page which has been updated. – PeanutsMonkey Aug 01 '11 at 02:57
  • I'd also like to redirect to a different page.. @PeanutsMonkey did you find a solution? – Blake Niemyjski Feb 26 '15 at 20:30