Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Clear all filters
Answers

HTTP to HTTPS Redirection excluding specific HTTP URL

Hi - I have a requirement for following scenario;

Website configured on ASM : Default HTTP to HTTPS redirection;

http://www.abc.com > redirects > https://www.abc.com

Is it possible to redirect www.abc.com from HTTP to HTTPS and EXCLUDE www.abc.com/xyz/ghq.asmx URL from this redirect?

0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Hello Omar,

Try the following irule, if starting with "/xyz/ghq.asmx" it will not redirect, otherwise it will redirect to https.

when HTTP_REQUEST {

    if { ! ( [string tolower [HTTP::uri]] starts_with "/xyz/ghq.asmx" ) } {
        HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]
    }

}

Hope it helps

Waiting for you feedback thanks

0
Comments on this Answer
Comment made 05-Sep-2017 by OmarKhan 54

Hi JTI - Its not working. Instead second condition executes only i.e.

   { HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]

After applying above irule when i browse to http://www.abc.com/xyz/ghq.asmx ..it redirects me to HTTPS version of this URL i.e. https://www.abc.com/xyz/ghq.asmx

0