Forum Discussion
Keith_J__106392
Nimbostratus
Jan 05, 2017URL redirect to multiple paths
Hi. I have a request for a host name (example.123.com) that I need to redirect to 2 different paths. If a user types https://example.123.com I need to redirect it to https://example.123.com/loginpage...
Vijay_E
Cirrus
Jan 05, 2017I haven't worked much with policies but iRule should be able to help you out. If you are looking to redirect, you should be able to use something like this:
when HTTP_REQUEST {
if { ([HTTP::host] eq "example.123.com") } {
if { ([HTTP::uri] eq "/") or ([HTTP::uri] eq "/loginpage2") } {
HTTP::respond 301 Location "https://example.123.com/loginpage1"
}
}
}
If you are just looking to replace the URI and send it directly to server instead of a redirect:
when HTTP_REQUEST {
if { ([HTTP::host] eq "example.123.com") } {
if { ([HTTP::uri] eq "/") or ([HTTP::uri] eq "/loginpage2") } {
HTTP::uri /loginpage1
}
}
}
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
