Forum Discussion

dkinsler_23191's avatar
dkinsler_23191
Icon for Nimbostratus rankNimbostratus
Aug 19, 2009

Missing anchor # from redirect

Hi all,

 

I have an Irule that redirects to https. The problem I am having is the redirect removes any anchors from the URI variable. For instance, if my link is:

 

 

http://host1.test123.com/extra/help/4rem9prestuqem5b/help.htmSoftware/Other_Software/Installing_GIMP.htm

 

 

after the redirect, I wind up with:

 

 

http://host1.test123.com/extra/help/4rem9prestuqem5b/help.htm

 

 

Any help would be greatly appriceated. Here in my Irule. X would be my real IP adderss.

 

 

when HTTP_REQUEST {

 

if { [IP::addr [IP::client_addr] equals X.X.X.X] } {

 

HTTP::respond 301 Location "https://[getfield [HTTP::host] : 1][HTTP::uri]" }

 

}

1 Reply

  • From what I can determine, anchor delimiters are not passed through from the browser on requests, they are used in responses to tell the browser if it should jump to an anchor tag in the response content. I ran a trace with HttpWatch to verify this and here's what showed up

     

     

    Browser Request: http://xpbert/foo/bartag1

     

     

    HttpWatch trace:

     

    (Request-Line): GET /foo/bar HTTP/1.1

     

    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

     

    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

     

    Accept-Encoding: gzip,deflate

     

    Accept-Language: en-us,en;q=0.5

     

    Connection: keep-alive

     

    Host: xpbert

     

    Keep-Alive: 300

     

    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2

     

     

     

    You'll see the GET request from the browser is "/foo/bar", not "/foo/bartag1". So it seems the browser is stripping off the anchor which means it wouldn't be getting to your backend server anyway.

     

     

    -Joe