# iRuless https to https path redirection

**URL:** <https://community.f5.com/t/iruless-https-to-https-path-redirection/3404>\
**Category:** Technical Forums\
**Tags:** irules, ltm, application-delivery\
**Created:** [May 8, 2019, 3:22pm UTC](https://community.f5.com/t/iruless-https-to-https-path-redirection/3404 "2019-05-08T15:22:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bobow\_211095](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@Bobow\_211095](https://community.f5.com/u/Bobow_211095)\
**Post date:** [May 8, 2019, 3:22pm UTC](https://community.f5.com/t/iruless-https-to-https-path-redirection/3404/1 "2019-05-08T15:22:14Z")

</div>

Hi,

I am trying to get the code correct for a simple URL redirect. I will need it to work **[https://abc.com](https://abc.com)** redirects to **[https://abc.com/123](https://abc.com/123)**

Any help with this will be greatly appreciated

Thanks!

---

<div class="post-metadata">

**Author:** ![tiziano\_rosato](https://avatars.discourse-cdn.com/v4/letter/t/53a042/32.png) [@tiziano\_rosato](https://community.f5.com/u/tiziano_rosato)\
**Post date:** [May 8, 2019, 3:47pm UTC](https://community.f5.com/t/iruless-https-to-https-path-redirection/3404/2 "2019-05-08T15:47:38Z")

</div>

If you like to use ltm policy insted of irule you can have a look here:

[https://devcentral.f5.com/articles/inside-the-big-ip-simple-url-redirects-32269](https://devcentral.f5.com/articles/inside-the-big-ip-simple-url-redirects-32269)

---

<div class="post-metadata">

**Author:** ![R\_Hickman\_1172](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@R\_Hickman\_1172](https://community.f5.com/u/R_Hickman_1172)\
**Post date:** [May 8, 2019, 3:54pm UTC](https://community.f5.com/t/iruless-https-to-https-path-redirection/3404/3 "2019-05-08T15:54:23Z")

</div>

As tiziano rosato mentioned- a LTM policy would work and be pretty easy, but if you would rather do an iRule - this is one I use frequently for these kind of URI redirects:

```tcl
when HTTP_REQUEST {
if {[HTTP::uri] equals {/}} {HTTP::uri {/123}
}
}

```

This assumes we don’t care so much about the host URL, only what comes after the /.
