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?
when HTTP_REQUEST {
if { [HTTP::host] eq "http://www.tq3navigant.com/northcentral"} {
HTTP::redirect "http://www.navigant.com/About/Locations/LocationsDetail.aspx?Region=NC&Hemi=West[HTTP::uri]" }
}
Thanks!
- hoolio
Cirrostratus
You 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]" } }
- Chad_Roberts_21
Nimbostratus
hoolio's answer is technically accurate--and you may already have put his advice to good, functional use--but for the sake of being thorough, and because I need all the practice I can get, I believe this is the way you would want that iRule of yours to be written:when HTTP_REQUEST { if { "[HTTP::host][HTTP::uri]" eq "www.tq3navigant.com/northcentral"} { HTTP::redirect "http://www.navigant.com/About/Locations/LocationsDetail.aspx?Region=NC&Hemi=West[HTTP::uri]" } }
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