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 configure LTM in such a way that traffic hitting 'abc.com' should be redirected to 'xyz.com' except for url 'abc.com/def'. When user hitting url 'abc.com/def' they shouldn't be redirected to xyz.com, instead they should be on url 'abc.com/def'.
Thanks
1 Reply
- Michael_Jenkins
Cirrostratus
You 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