Forum Discussion
MikeM_44778
Nimbostratus
Feb 28, 2010Multiple Redirect based on URI
Trying to create a single iRule to do the following:
http://website1/News/?search=1234 redirects to http://website2/News/?search=1234
http://website1/Tech/?search=1234 redirect...
hoolio
Cirrostratus
Mar 01, 2010As the HTTP host header value must be evaluated without regard to case, it would make sense to set the host value to lower case. If you need to check the case for the URI, you can leave the URI unchanged for the evaluation:
when HTTP_REQUEST {
if {[string tolower [HTTP::host]] eq "www.website1.com"} {
switch -glob [HTTP::uri] {
"*News*" -
"*Tech*" -
"*SportsPage*" { HTTP::redirect "http://website2.com/[HTTP::uri]" }
}
}
}
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
