Forum Discussion
Robb_Holzer_770
Nimbostratus
Aug 09, 2006IRule Redirect Question
I am trying to setup an iRule for 9x that simply reads an HTTP header and then redirects to a new URL....
My rule currently is follows but is not working, suggestions on what I might try? ...
hoolio
Cirrostratus
Aug 09, 2006You can add a logging statement to the rule to find out what host you're making the comparison against:
when HTTP_REQUEST {
if { [HTTP::host] eq "http://www.tq3navigant.com/northcentral"} {
log local0.info "Host: [HTTP::host]"
HTTP::redirect "http://www.navigant.com/About/Locations/LocationsDetail.aspx?Region=NC&Hemi=West[HTTP::uri]" }
}
The output will be logged to /var/log/ltm.
I think you'll find the Host header doesn't include the protocol or the URI. Here is the format:
http://myhost.com/myUri/
where http is the protocol, myhost.com is the host and /myUri/ is the URI.
So you would want to match against "www.tq3navigant.com"
Aaron
[with edits for typing faster than I was thinking...]
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects