# URI based redirect

**URL:** <https://community.f5.com/t/uri-based-redirect/27247>\
**Category:** Technical Forums\
**Tags:** dev, irules, v4, devops, application-delivery\
**Created:** [August 17, 2006, 12:39pm UTC](https://community.f5.com/t/uri-based-redirect/27247 "2006-08-17T12:39:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeremy\_Lanzarot](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@Jeremy\_Lanzarot](https://community.f5.com/u/Jeremy_Lanzarot)\
**Post date:** [August 17, 2006, 12:39pm UTC](https://community.f5.com/t/uri-based-redirect/27247/1 "2006-08-17T12:39:27Z")

</div>

We have several applications running behind this particular VIP, all using the same pool. We migrated one application so that we required it use the same VIP but be redirected to another pool. The problem we were seeing is that between 20 and 40% of the time we would be presented with 404 errors when testing other applications on the VIP that were still supposed to use the old pool. I have been asked to see if the irule coding had anything to do with this failure becasue oddly enough, when the irule was removed the 404’s on the other applications went away. We are using 4.2 PTF 10. Here is the irule:

if (http\_uri starts\_with “/Engineering/WeightCalc”) {

redirect to “http://%h/WeightCalc/”

}

else if (http\_uri starts\_with “/WeightCalc”) {

use ( asep702a\_7000 )

}

else {

use ( efactory-http )

}

Thanks you.

---

<div class="post-metadata">

**Author:** ![Colin\_Walker\_12](https://avatars.discourse-cdn.com/v4/letter/c/a88e4f/32.png) [@Colin\_Walker\_12](https://community.f5.com/u/Colin_Walker_12)\
**Post date:** [October 10, 2006, 4:55pm UTC](https://community.f5.com/t/uri-based-redirect/27247/2 "2006-10-10T16:55:38Z")

</div>

Could it be that the WeightCalc URI isn’t valid on some of the hosts? This would make sense as to why you’re seeing the problem when redirecting all requests to that URI if they match your criteria.

Other than that, the rule looks fine.

Colin
