Forum Discussion
Zulfeqar_Ahmed_
Nimbostratus
Dec 29, 2016Want to merge two irules
i am looking to redirect all the traffic which is going to old-domain.com to new-domain.com and also simultaneously i want all the pages,sub pages,menus to be redirected to https...
please advis...
Stanislas_Piro2
Cumulonimbus
Dec 29, 2016Hi,
you can try this code:
when HTTP_REQUEST {
if { [HTTP::host] equals "old-domain.com" } {
HTTP::redirect "https://new-domain.com"
} elseif { [HTTP::uri] equals "/" } {
HTTP::uri "/irj/portal"
}
}For your information, URI never equals "". it always starts with / even if the browser does not display it.
I recommend to redirect to /irj/portal instead of changing URI:
when HTTP_REQUEST {
if { [HTTP::host] equals "old-domain.com" } {
HTTP::redirect "https://new-domain.com"
} elseif { [HTTP::uri] equals "/" } {
HTTP::redirect "/irj/portal"
}
}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