Forum Discussion
Amit585731
Nimbostratus
Mar 17, 2015URL redirection
Hi All,
Is it possible to redirect traffic based on url. Currently we have setup LTM in such a way that traffic hitting 'abc.com' is routed to 'xyz.com'. But due to certain issue we now need to ...
Michael_Jenkins
Cirrostratus
Mar 17, 2015You can do this simply with an iRule like this:
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
"abc.com" -
"www.abc.com" {
You could use "starts_with" instead if you wanted.
if {!([string tolower [HTTP::uri]] equals "/def")} {
This will use the same protocol that is currently being used on the request
HTTP::redirect "//xyz.com[HTTP::uri]"
return
}
}
}
}
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