Forum Discussion
irule - host and uri redirect
Hi
Looking for assistance to create IRULE to redirect the following urls. Any assistance is appreciated in advance
VIP -10.10.10.1 -abcd.com
http://abcd.com/ redirected to http://www.xyz.com/providers/systems/electronic/ http://abcd.com/the-advantage/ redirected to http://www.xyz.com/providers/systems/for-you/ http://abcd.com/financial-app redirected to http://www.xyz.com/contact/ http://abcd.com/featured-test-app redirected to http://www.xyz.com/test/
3 Replies
- TT_179079
Nimbostratus
http://abcd.com/ redirected to http://www.xyz.chttp://www.xyz.com/providers/systems/electronic/
- TT_179079
Nimbostratus
here is my irule, any comment on modifying the irule
HTTP_REQUEST { if { ([HTTP::host] equals "abcd.com") and ([HTTP::uri] equals "/") } { HTTP::redirect "http://www.xyz.com/providers/systems/electronic/" } if { ([HTTP::host] equals "abcd.com") and ([HTTP::uri] equals "the-advantage/") } { HTTP::redirect "http://www.xyz.com/providers/systems/for-you" } if { ([HTTP::host] equals "abcd.com") and ([HTTP::uri] equals "featured-financial-app") } HTTP::redirect "http://www.xyz.com/contact" } if { ([HTTP::host] equals "abcd.com") and ([HTTP::uri] equals "featured-test-app") } HTTP::redirect "http://www.xyz.com/test" } }
- janholtz
Altostratus
Here we go:
when HTTP_REQUEST { if {[HTTP::host] equals "abcd.com" } { switch -glob [HTTP::uri] { "" - "/" { HTTP::redirect "http://www.xyz.com/providers/systems/electronic/" } "/the-advantage*" { HTTP::redirect "http://www.xyz.com/providers/systems/for-you/" } "/financial-app*" { HTTP::redirect "http://www.xyz.com/contact/" } "/featured-test-app*" { HTTP::redirect "http://www.xyz.com/test/" } } } }//Jan
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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