Forum Discussion
Aaron_S_01_1634
Nimbostratus
Feb 22, 2017iRule to redirect to home page if URI contains email address
Hey all,
We've gotten a request for an iRule on a system living on a legacy 10.x system (being decommed soon) that redirects to the home page if the URI contains an email address. If I were doi...
DevBabu
Cirrus
Feb 22, 2017May be something like this. I have not tested it and used the regular expression that you have in question . If regular expression match redirect to some page. More on regexp can be found on.
https://devcentral.f5.com/articles/irules-101-10-regular-expressions
when HTTP_REQUEST {
set uri [HTTP::uri]
set result [regexp {[_A-Za-z0-9-\+]+(.[_A-Za-z0-9-]+)(@|\%40)[A-Za-z0-9-]+(.[A-Za-z0-9]+)(.[A-Za-z]{2,})} $uri]
if($result)
{
HTTP::redirect "http://www.example.com/newlocation.html"
}
}
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