Forum Discussion
tsm_329805
Nimbostratus
Aug 08, 2017Irule redirection from old URL (abc.com) to new URL (xyz.com)
All,
Looking for irule to redirect when user hits abc.com that should redirect to xyz.com.
Note: xyz.com is just a CNAME for abc.com.
looking forward for your help.
Thanks,
TS
Yann_Desmarest
Cirrus
Aug 08, 2017Hi,
You can use the following irule :
when HTTP_REQUEST {
if { [HTTP::host] eq "abc.com" } {
HTTP::respond 302 noserver Location "http://xyz.com" Connection Close
alternative : HTTP::redirect "http://xyz.com"
}
}
Or you may prefer to use an LTM policy for that.
Yann
Yann_Desmarest
Cirrus
Aug 08, 2017Yes sure. it's still valid.
I prefer using
HTTP::respond but you can also use HTTP::redirect. I prefer the first option because you have more control on the response like removing Server header, Closing connection, etc.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