Forum Discussion

ryan_miller_110's avatar
ryan_miller_110
Icon for Nimbostratus rankNimbostratus
Oct 12, 2006

HTTP::redirect not rewriting client browser URL

 

 

The following iRule is preventing images from displaying in the client browser. The URL in the browser is also not being updated with the 'HTTP::redirect' value. This code is set to redirect any requests not fully qualified (ex> https://209.10.201.33/page.htm should redirect to https://www.somewebsite.com/page.htm as would https://somewebsite.com/page.htm). I also perform this redirect in the HTTPS profile so that when users are redirected to the HTTPS virtual, they are not prompted to accept an SSL cert doesn't match the host name).

 

 

when HTTP_REQUEST {

 

set host [string tolower [HTTP::host]]

 

if { ( $host ne "www.somewebsite.com" ) } {

 

set path [HTTP::path]

 

HTTP::redirect "https://www.somewebsite.com$path"

 

}

 

}

 

 

if I wrap a conditional evaluation that excludes the images class, the images on the page do show up as expected.

 

 

I have 2 virtual servers setup. 1 for HTTP, 1 for HTTPS traffic. This rule is associated with the HTTPS pool. This is a brand new 1500, and I am trying to upgrade to these devices from a pair of 540's running v4.5.12.

 

 

 

Any ideas?

3 Replies

  • Hi,

     

     

    The rule looks okay. Can you add log statements to verify that the $path variable contains what you are expecting and that the event is being triggered when you expect it to? You can check the /var/log/ltm file for the log output.

     

     

    Then try using HTTP watch for IE or LiveHTTPheaders for Firefox to see what the client is receiving when hitting the rule.

     

     

    Aaron
  • 1st... thank you, the URI is a good catch.

     

     

    2nd... my problem is a defect with BigIp not loading iRule changes. I have to restart tmm service after synchronizing for any changes to show up. What a waist of time !

     

     

    Cheers!
  • I've seen this sporadically, but haven't been able to capture enough debug information to escalate it. You might consider opening a case with support to pursue the issue. Running qkview while the rule running in memory is different than the one configured would help.

     

     

    Good to hear that your rule is working though.

     

     

    Aaron