Forum Discussion
Hajar
Nimbostratus
Feb 19, 2016Redirect subfolders
Hello, How can I write an iRule to do a redirect from F5 to our cloud site(no pool in F5). I need to make sure to redirect top level and also any other folders to exact folder name on cloud.
for example
Top-level redirect
http://my.x.com => https://cloud.y.com/y/y.do
Article redirect, for any article ID "XXXX"
http://my.x.com/XXXX => https://cloud.y.com/y/y.do?id=XXXX
1 Reply
Hi Hajar,
you may use this snippet as a starting point...
when HTTP_REQUEST { if { [string tolower [HTTP::host]] equals "my.x.com" } then { if { [HTTP::uri] equals "/" } then { HTTP::redirect "https://cloud.y.com/y/y.do" } else { HTTP::redirect "https://cloud.y.com/y/y.do?id=[URI::encode [string range [HTTP::uri] 1 end]]" } } }Cheers, Kai
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
