Forum Discussion
cin_75063
Nimbostratus
Sep 16, 2009Redirecting HTTP to HTTPS except certain URLs
Hi
I want to redirect all HTTP request to HTTPS except certain URIs("/abc/0001, /abc/0002, .... /abc/000n").
I'm very new to iRule, so I'd appreciate it if someone could review ...
hoolio
Cirrostratus
Sep 17, 2009That makes sense. If you define the datagroup as /abc/, /xyz/, then you can make the iRule simpler:
when HTTP_REQUEST {
if {not [matchclass [HTTP::uri] starts_with $::redirect_group]}{
Redirect to https
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
}
}
If the web app is not case sensitive, you could enter the class members in lower case and then set the URI to lower case by replacing [HTTP::uri] in matchclass with [string tolower [HTTP::uri]].
Aaron
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