# HTTPS to HTTP irule - yes it's backwards

**URL:** <https://community.f5.com/t/https-to-http-irule-yes-its-backwards/56076>\
**Category:** Technical Forums\
**Tags:** irules, devops, application-delivery\
**Created:** [July 20, 2015, 9:35pm UTC](https://community.f5.com/t/https-to-http-irule-yes-its-backwards/56076 "2015-07-20T21:35:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![JN](https://avatars.discourse-cdn.com/v4/letter/j/7feea3/32.png) [@JN](https://community.f5.com/u/JN)\
**Post date:** [July 20, 2015, 9:35pm UTC](https://community.f5.com/t/https-to-http-irule-yes-its-backwards/56076/1 "2015-07-20T21:35:22Z")

</div>

Trying to create a HTTPS to HTTP redirect irule to force incoming S connections to use the http vip. I just tried to copy the built-in HTTPS\>HTTP irule, but it did not like that. Any suggestions?

Thanks

---

<div class="post-metadata">

**Author:** ![Kevin\_Stewart](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/kevin_stewart/32/15267_2.png) [@Kevin\_Stewart](https://community.f5.com/u/Kevin_Stewart)\
**Post date:** [July 20, 2015, 10:05pm UTC](https://community.f5.com/t/https-to-http-irule-yes-its-backwards/56076/2 "2015-07-20T22:05:12Z")

</div>

How does it fail?

```tcl
when HTTP_REQUEST {    
    HTTP::redirect "http://[HTTP::host][HTTP::uri]"
}

```

Do you have a client SSL profile applied to the VIP?

---

<div class="post-metadata">

**Author:** ![JN](https://avatars.discourse-cdn.com/v4/letter/j/7feea3/32.png) [@JN](https://community.f5.com/u/JN)\
**Post date:** [July 20, 2015, 10:06pm UTC](https://community.f5.com/t/https-to-http-irule-yes-its-backwards/56076/3 "2015-07-20T22:06:43Z")

</div>

I admit I was reliant on the sharepoint resource to tell me if it was working or not. They simply said it wasn’t directing to the page. No SSL profiles.

---

<div class="post-metadata">

**Author:** ![Kevin\_Stewart](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/kevin_stewart/32/15267_2.png) [@Kevin\_Stewart](https://community.f5.com/u/Kevin_Stewart)\
**Post date:** [July 20, 2015, 10:09pm UTC](https://community.f5.com/t/https-to-http-irule-yes-its-backwards/56076/4 "2015-07-20T22:09:45Z")

</div>

If you have a VIP listening on HTTPS/port 443, you need an HTTP profile and client SSL profile in order to use this iRule.

---

<div class="post-metadata">

**Author:** ![Arie](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Arie](https://community.f5.com/u/Arie)\
**Post date:** [July 21, 2015, 3:52pm UTC](https://community.f5.com/t/https-to-http-irule-yes-its-backwards/56076/5 "2015-07-21T15:52:16Z")

</div>

What’s the rationale for redirecting from HTTPS to HTTP? If it’s merely to satisfy a back-end requirement you might be able to host the instance by terminating HTTPS on the BIG-IP:

```tcl
client <----HTTPS----> big-ip <----HTTP----> origin web servers

```

---

<div class="post-metadata">

**Author:** ![Kevin\_Stewart](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/kevin_stewart/32/15267_2.png) [@Kevin\_Stewart](https://community.f5.com/u/Kevin_Stewart)\
**Post date:** [July 21, 2015, 5:36pm UTC](https://community.f5.com/t/https-to-http-irule-yes-its-backwards/56076/6 "2015-07-21T17:36:53Z")

</div>

agree on the HTTP profile, not on the SSL profile since it’s coming in unencrypted. Probably should have mentioned that also.

If a user types into the browser URL, the browser **is going to attempt to do SSL**. There’s really no way around this. So in order to catch layer 7 HTTP requests on a VIP listening on port 443 for HTTPS requests, you need to be able to terminate the incoming SSL with a client SSL profile.
