adamo_1516
Aug 14, 2007Nimbostratus
exception logic for selective https redirect
yes, i'm losing my mind.
i've got a rule we put in place to take specific subdomains and statically redirect the URL's to https. it works great, but we're now seeing we need to add exception logic for a specific URI beforehand, and i've been unable to figure it out.
our existing rule looks like this:
when HTTP_REQUEST {
if { ([HTTP::host] starts_with "subdomain1." ) or ([HTTP::host] starts_with "subdomain2.") } {
HTTP::redirect https://[HTTP::host][HTTP::uri]
}
}
we need to add logic for this:
if { ([HTTP::uri] contains "SpecialUrl") } {
then it needs to allow HTTP, and *NOT* redirect to HTTPS. i'm thinking an 'else' would do it, but i'm not so sure what to do for the statement for the action.. would an HTTP redirect to the same exact URL work (simiular to this):
HTTP::redirect http://[HTTP::host][HTTP::uri]
i just can't get any of this to tie together, and really need to get this working since our prod environment now has an issue. any help appreciated!!
-adam