# I rule for redirection

**URL:** <https://community.f5.com/t/i-rule-for-redirection/19485>\
**Category:** Technical Forums\
**Tags:** availability, deployment, irules, devops, application-delivery, ltm, microsoft\
**Created:** [July 22, 2014, 12:22am UTC](https://community.f5.com/t/i-rule-for-redirection/19485 "2014-07-22T00:22:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![karan12\_154818](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@karan12\_154818](https://community.f5.com/u/karan12_154818)\
**Post date:** [July 22, 2014, 12:22am UTC](https://community.f5.com/t/i-rule-for-redirection/19485/1 "2014-07-22T00:22:52Z")

</div>

On one of the HTTPS virtual server,was already using i-rule as below:-

when HTTP\_REQUEST { if { [HTTP::uri] contains “xxx” } { node 10.x.x.x%xxx:x } } Now client is asking for redirection of HTTPS url([https://170.x.x.x/analytics](https://170.x.x.x/analytics)) to [https://170.x.x.x/analytics/saw.dll?home&startPage=1](https://170.x.x.x/analytics/saw.dll?home&startPage=1) also so applied irule as below:-

when HTTP\_REQUEST { if { [HTTP::uri] starts\_with “/analytics” } { HTTP::redirect “/analytics/saw.dll?home&startPage=1” } }

But on applying this it is getting looped.Can you please suggest is there a way to club both the i-rule or what should be correct i-rule to achieve this.

---

<div class="post-metadata">

**Author:** ![MiLK\_MaN](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@MiLK\_MaN](https://community.f5.com/u/MiLK_MaN)\
**Post date:** [July 22, 2014, 12:25am UTC](https://community.f5.com/t/i-rule-for-redirection/19485/2 "2014-07-22T00:25:46Z")

</div>

It’s because the starts\_with operator will match both /analytics and /analytics/saw.dll?home&startPage=1

You should change starts\_with to be eq so it only matches the /analytics and not everything else.

---

<div class="post-metadata">

**Author:** ![karan12\_154818](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@karan12\_154818](https://community.f5.com/u/karan12_154818)\
**Post date:** [July 22, 2014, 2:08am UTC](https://community.f5.com/t/i-rule-for-redirection/19485/3 "2014-07-22T02:08:59Z")

</div>

Changed starts\_with to be eq now its not looping.

Thanks a lot!!
