# irule variable

**URL:** <https://community.f5.com/t/irule-variable/62214>\
**Category:** Technical Forums\
**Tags:** irules, ltm, application-delivery\
**Created:** [August 12, 2021, 3:36pm UTC](https://community.f5.com/t/irule-variable/62214 "2021-08-12T15:36:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![EdC123](https://avatars.discourse-cdn.com/v4/letter/e/e68b1a/32.png) [@EdC123](https://community.f5.com/u/EdC123)\
**Post date:** [August 12, 2021, 3:36pm UTC](https://community.f5.com/t/irule-variable/62214/1 "2021-08-12T15:36:12Z")

</div>

Hi, I need to create an irule that looks for the first part of a URI in a web request and then appends that value as a folder. For instance: [test.host1.example.com](http://test.host1.example.com) would need to be processed and then redirected to [host1.example.com/a/b/test/z1/](http://host1.example.com/a/b/test/z1/)

does anyone know what is the best way to program this as an irule?

thanks!!

Ed

---

<div class="post-metadata">

**Author:** ![spalande](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/spalande/32/10043_2.png) [@spalande](https://community.f5.com/u/spalande)\
**Post date:** [August 13, 2021, 11:03am UTC](https://community.f5.com/t/irule-variable/62214/2 "2021-08-13T11:03:59Z")

</div>

are a, b and z1 directories static or it can be anything?
