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 user goes to either of these URL's (same hostname) don't redirect: http://one.abc.com/sites/HR or http://one.abc.com/Pages/AboutMe.aspx
Thanks, Pete
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