Forum Discussion
Pete_Paiva_7147
Jul 24, 2017Nimbostratus
iRule redirect based on hostname
Looking for some assistance in creating an iRule that would do the following:
User goes to http://one.abc.com/* redirect to http://one.xyz.com/sites/sync/SitePages/Home.aspx
However, if use...
- Jul 24, 2017
Try something like this:
when HTTP_REQUEST { if {[string tolower [HTTP::host]] equals "one.abc.com"}{ if {not (([string tolower [HTTP::path]] starts_with "/sites/hr") || ([string tolower [HTTP::path]] equals "/pages/aboutme.aspx"))}{ HTTP::redirect "http://one.xyz.com/sites/sync/SitePages/Home.aspx" } } }
https://devcentral.f5.com/wiki/iRules.HTTP.ashx
https://devcentral.f5.com/wiki/iRules.HTTP__host.ashx
Cory_O
Jul 24, 2017Cirrus
I'm not sure what version you're running, but have you looked into Local Traffic Policies?
I use them for my HTTP to HTTPS redirects as dictated in this article: https://support.f5.com/csp/article/K26312346
Hope that helps!
-C
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