Forum Discussion
DM_5174
Nimbostratus
Jun 11, 2008HTTP to another URL redirection does not work
Hi All,
I have the following i-rule that does not work and I have no clue what the problem is, and if its with the irule or the LTM (virtual server profile etc...)
The ru...
The_Bhattman
Nimbostratus
Jun 12, 2008I never took the time to validate my code. Now that I have a second look at it, I think I fixed it adding in the portion to lowercase the evalulation.
Here is the items fixed again also handling the capital and lower case letters
Other Way 1 fixed
when HTTP_REQUEST {
if { [HTTP::host] eq "www.oldsite.com" }{
if {[string tolower [HTTP::uri]] eq "/newapp" }{
HTTP::redirect "http://www.newsite.com/home/index.html"
} else {
pool web_POOL7
}
}
}
Other Way 2
when HTTP_REQUEST {
set url [string tolower [HTTP::host][HTTP::uri]]
if { $uri eq "www.oldsite.com/newapp" }{
HTTP::redirect "http://www.newsite.com/home/index.html"
} else {
pool web_POOL7
}
}
Other way 3
when HTTP_REQUEST {
set url [string tolower [HTTP::host][HTTP::uri]]
switch -glob $url {
"www.oldsite.com/newapp" { HTTP::redirect "http://www.newsite.com/home/index.html" }
default { pool web_POOL7 }
}
}
CB
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