Forum Discussion
Bob_10976
Nimbostratus
Mar 25, 2010Rewrite rule not working, what am I missing?
I have this iRule that works fine, with the exception of the last entry, which I can't seem to get to take. This is assiged to our MOSS farm, so we have several web sites under one pool. I added the...
hoolio
Cirrostratus
Mar 25, 2010Hi Bob,
Your last check is on the HTTP::host value, but you're looking for a host and URI.
You can use switch to do this a little cleaner and more efficiently:
when HTTP_REQUEST {
switch "[string tolower [HTTP::host]]" {
"domain1.com" -
"www.domain1.com" {
HTTP::respond 301 Location "http://domain2.com
}
"domain3.com" -
"www.domain3.com" {
HTTP::respond 301 Location "https://domain3-edit.com
}
"www.domain4.com" {
HTTP::respond 301 Location "http://domain4.com/"
}
"domain5.com" {
HTTP::respond 301 Location "https://domain5-edit.com/"
}
"www.domain6.com" {
HTTP::respond 301 Location "http://domain6.com/"
}
"www.domain7.com" {
HTTP::respond 301 Location "http://domain7.com/"
}
"domain7.com" {
if {[string tolower [HTTP::uri]] eq "/security"}{
HTTP::respond 301 Location "http://domain7.com/"ciso/pages/services.aspx
}
}
}
}
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