# 80 and 443 redirection

**URL:** <https://community.f5.com/t/80-and-443-redirection/19183>\
**Category:** Technical Forums\
**Tags:** irules, design, availability, big-ip-access-policy-manager-apm, security, devops, application-delivery\
**Created:** [November 22, 2013, 5:11pm UTC](https://community.f5.com/t/80-and-443-redirection/19183 "2013-11-22T17:11:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aspindler34\_133](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@aspindler34\_133](https://community.f5.com/u/aspindler34_133)\
**Post date:** [November 22, 2013, 5:11pm UTC](https://community.f5.com/t/80-and-443-redirection/19183/1 "2013-11-22T17:11:44Z")

</div>

what is the simplest “best practice” way, via an irule, to redirect users from 80 to 443 after ssl offload performed on an LTM?

---

<div class="post-metadata">

**Author:** ![Bhanu\_9561](https://avatars.discourse-cdn.com/v4/letter/b/f1d935/32.png) [@Bhanu\_9561](https://community.f5.com/u/Bhanu_9561)\
**Post date:** [November 22, 2013, 5:54pm UTC](https://community.f5.com/t/80-and-443-redirection/19183/2 "2013-11-22T17:54:34Z")

</div>

Apply this iRule to a VIP that is listening on port 80.

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

```

---

<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:** [November 22, 2013, 6:37pm UTC](https://community.f5.com/t/80-and-443-redirection/19183/3 "2013-11-22T18:37:52Z")

</div>

You actually don’t even have to do that. Every LTM comes with a built-in HTTP-to-HTTPS redirect iRule called \_sys\_redirect (or something like that).

---

<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:** [November 22, 2013, 7:13pm UTC](https://community.f5.com/t/80-and-443-redirection/19183/4 "2013-11-22T19:13:16Z")

</div>

Not sure what version of LTM you’re running, but if we’re talking about \_sys\_http\_redirect, it most certainly does retain the URI.
