Forum Discussion
Ahmadj_283318
Nimbostratus
Aug 25, 2016Redirect many domains
Hi
I am trying to create an iRule to:
redirect (www.x.com to www.x.com/a/b/c)
and
redirect (www.y.com to www.y.com/w/d/r)
and
redirect any (a.com/z/v to domain.com)
also redirect (a.com/z/v/p to a.com/z/v/p)
Thank you for help..
4 Replies
- JG
Cumulonimbus
Are you sure about this, redirecting to itself?
also redirect (a.com/z/v/p to a.com/z/v/p) - JG
Cumulonimbus
when HTTP_REQUEST { switch -- [string tolower [HTTP::host]] { "www.x.com" { HTTP::redirect "https://www.x.com/a/b/c/" } "www.y.com" { HTTP::redirect "https://www.y.com/w/d/r/" } "a.com" { if { [HTTP::uri] starts_with "/z/v/p" } { HTTP::redirect "https://domain.com/z/v/p" } elseif { [HTTP::uri] starts_with "/z/v" } { HTTP::redirect "https://a.com/" } } } } - Bart_18836
Nimbostratus
Why not using policies. These are available starting 11.4 and are more efficient than iRule in this case. see here for details:
https://support.f5.com/kb/en-us/solutions/public/15000/000/sol15085.html
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