# Need an IRule

**URL:** <https://community.f5.com/t/need-an-irule/20141>\
**Category:** Technical Forums\
**Tags:** irules, security\
**Created:** [August 29, 2016, 12:45pm UTC](https://community.f5.com/t/need-an-irule/20141 "2016-08-29T12:45:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sachin\_M\_258695](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@Sachin\_M\_258695](https://community.f5.com/u/Sachin_M_258695)\
**Post date:** [August 29, 2016, 12:45pm UTC](https://community.f5.com/t/need-an-irule/20141/1 "2016-08-29T12:45:15Z")

</div>

Hi,

I need an urgent irule for the requirement.

If uri contains xyz… It has to route to one public VIP

if [www.abc.com/xyz](http://www.abc.com/xyz)\* It has to go to 1.1.1.1

Please provide the complete IRule

Kindly help

thanks Sachin M

---

<div class="post-metadata">

**Author:** ![Kai\_Wilke](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/kai_wilke/32/24646_2.png) [@Kai\_Wilke](https://community.f5.com/u/Kai_Wilke)\
**Post date:** [August 29, 2016, 2:26pm UTC](https://community.f5.com/t/need-an-irule/20141/2 "2016-08-29T14:26:50Z")

</div>

Please explain your usecase in a more detailed fashion to (at least) enable us to provide a solution that meets your requirements.

If uri contains xyz… It has to route to one public VIP

What means “route to one public VIP”?

if \* It has to go to 1.1.1.1

The previous rule and this rule contains both xyz?

Cheers, Kai

---

<div class="post-metadata">

**Author:** ![ekaleido](https://avatars.discourse-cdn.com/v4/letter/e/e495f1/32.png) [@ekaleido](https://community.f5.com/u/ekaleido)\
**Post date:** [August 29, 2016, 2:34pm UTC](https://community.f5.com/t/need-an-irule/20141/3 "2016-08-29T14:34:20Z")

</div>

I’m under the impression VIP and pool are being used interchangeably here. Curious for clarification as well.

---

<div class="post-metadata">

**Author:** ![Vijay\_E](https://avatars.discourse-cdn.com/v4/letter/v/4bbf92/32.png) [@Vijay\_E](https://community.f5.com/u/Vijay_E)\
**Post date:** [August 29, 2016, 4:08pm UTC](https://community.f5.com/t/need-an-irule/20141/4 "2016-08-29T16:08:21Z")

</div>

```tcl
when HTTP_REQUEST {
if { ([HTTP::host] eq "www.abc.com") and ([string tolower [HTTP::uri]] starts_with "/xyz" } {
virtual VS_1
}
}

```

Reference: [Virtual Server](https://devcentral.f5.com/wiki/iRules.virtual.ashx)

---

<div class="post-metadata">

**Author:** ![Sachin\_M\_258695](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@Sachin\_M\_258695](https://community.f5.com/u/Sachin_M_258695)\
**Post date:** [August 30, 2016, 11:36am UTC](https://community.f5.com/t/need-an-irule/20141/5 "2016-08-30T11:36:05Z")

</div>

Hi

Yes, i want that traffic to be routed to one Public VIP.

Thanks
