# HTTP to HTTPS Redirection excluding specific HTTP URL

**URL:** <https://community.f5.com/t/http-to-https-redirection-excluding-specific-http-url/12009>\
**Category:** Technical Forums\
**Tags:** irules, asm-advanced-waf, application-delivery\
**Created:** [September 5, 2017, 12:50am UTC](https://community.f5.com/t/http-to-https-redirection-excluding-specific-http-url/12009 "2017-09-05T00:50:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![OmarKhan\_249581](https://avatars.discourse-cdn.com/v4/letter/o/13edae/32.png) [@OmarKhan\_249581](https://community.f5.com/u/OmarKhan_249581)\
**Post date:** [September 5, 2017, 12:50am UTC](https://community.f5.com/t/http-to-https-redirection-excluding-specific-http-url/12009/1 "2017-09-05T00:50:31Z")

</div>

Hi - I have a requirement for following scenario;

Website configured on ASM : Default HTTP to HTTPS redirection;

[http://www.abc.com](http://www.abc.com) \> redirects \> [https://www.abc.com](https://www.abc.com)

Is it possible to redirect from HTTP to HTTPS and EXCLUDE URL from this redirect?

---

<div class="post-metadata">

**Author:** ![Jad\_Tabbara\_J1](https://avatars.discourse-cdn.com/v4/letter/j/2acd7d/32.png) [@Jad\_Tabbara\_J1](https://community.f5.com/u/Jad_Tabbara_J1)\
**Post date:** [September 5, 2017, 8:11am UTC](https://community.f5.com/t/http-to-https-redirection-excluding-specific-http-url/12009/2 "2017-09-05T08:11:19Z")

</div>

Hello Omar,

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

```tcl
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
