# Help with redirect https

**URL:** <https://community.f5.com/t/help-with-redirect-https/33154>\
**Category:** Technical Forums\
**Tags:** irules, application-delivery\
**Created:** [April 8, 2016, 1:13pm UTC](https://community.f5.com/t/help-with-redirect-https/33154 "2016-04-08T13:13:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rob\_Higginbotha](https://avatars.discourse-cdn.com/v4/letter/r/67e7ee/32.png) [@Rob\_Higginbotha](https://community.f5.com/u/Rob_Higginbotha)\
**Post date:** [April 8, 2016, 1:13pm UTC](https://community.f5.com/t/help-with-redirect-https/33154/1 "2016-04-08T13:13:15Z")

</div>

I wrote this iRule below and it works great for the most part but, when someone types [https://iam.company.com](https://iam.company.com) it won’t redirect. It only redirects [http://iam.company.com](http://iam.company.com) to [https://iam.company.com:8443/aveksa/main.](https://iam.company.com:8443/aveksa/main) Is there a way to get it to redirect https as well? Thanks for your help!

when HTTP\_REQUEST { if { [string tolower [HTTP::host]] eq “[iam.company.com](http://iam.company.com)” } then { if { [HTTP::uri] eq “/” } then { HTTP::redirect “[https://iam.company.com:8443/aveksa/main](https://iam.company.com:8443/aveksa/main)” } } }

---

<div class="post-metadata">

**Author:** ![Josiah\_39459](https://avatars.discourse-cdn.com/v4/letter/j/9de053/32.png) [@Josiah\_39459](https://community.f5.com/u/Josiah_39459)\
**Post date:** [April 8, 2016, 1:36pm UTC](https://community.f5.com/t/help-with-redirect-https/33154/2 "2016-04-08T13:36:58Z")

</div>

I’m guessing you have two vips, one on 80 and one on 443 and this irule is on the 80 vip. If you put it on BOTH the 80 vip and the 443 vip, you will get the behavior you desire.

---

<div class="post-metadata">

**Author:** ![Daniel\_Varela](https://avatars.discourse-cdn.com/v4/letter/d/57b2e6/32.png) [@Daniel\_Varela](https://community.f5.com/u/Daniel_Varela)\
**Post date:** [April 8, 2016, 1:38pm UTC](https://community.f5.com/t/help-with-redirect-https/33154/3 "2016-04-08T13:38:43Z")

</div>

Have you attached that irule to the VS listening on port 8443?
