# irule redirect question

**URL:** <https://community.f5.com/t/irule-redirect-question/44264>\
**Category:** Technical Forums\
**Tags:** irules, devops, application-delivery, ltm\
**Created:** [June 16, 2015, 4:00pm UTC](https://community.f5.com/t/irule-redirect-question/44264 "2015-06-16T16:00:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![theXfactor82\_91](https://avatars.discourse-cdn.com/v4/letter/t/a87d85/32.png) [@theXfactor82\_91](https://community.f5.com/u/theXfactor82_91)\
**Post date:** [June 16, 2015, 4:00pm UTC](https://community.f5.com/t/irule-redirect-question/44264/1 "2015-06-16T16:00:05Z")

</div>

We are moving a PeopleFinder feature over to a new Server so I am wanting to know if an irule could take care of the following…

request is [Login | HSTS Redirection Community](http://site.com/path/peoplefinder_advanced.pl?searchStr=username&searchAttr=uid)

redirect to [http://newsite.com/peoplefinder.aspx?searchStr=username&searchAttr=uid](http://newsite.com/peoplefinder.aspx?searchStr=username&searchAttr=uid)

If someone could direct me to a solution that would be great. Thanks

---

<div class="post-metadata">

**Author:** ![Samir\_Jha\_52506](https://avatars.discourse-cdn.com/v4/letter/s/a6a055/32.png) [@Samir\_Jha\_52506](https://community.f5.com/u/Samir_Jha_52506)\
**Post date:** [June 16, 2015, 5:26pm UTC](https://community.f5.com/t/irule-redirect-question/44264/2 "2015-06-16T17:26:45Z")

</div>

Please try this.

```tcl
when HTTP_REQUEST {
        if { [HTTP::uri] start_with "/path/path/peoplefinder_advanced.pl" } {
    HTTP::redirect "http://newsite.com/peoplefinder.aspx?[URI::query [HTTP::uri]]"
        }
        }

```

---

<div class="post-metadata">

**Author:** ![theXfactor82\_91](https://avatars.discourse-cdn.com/v4/letter/t/a87d85/32.png) [@theXfactor82\_91](https://community.f5.com/u/theXfactor82_91)\
**Post date:** [June 16, 2015, 6:39pm UTC](https://community.f5.com/t/irule-redirect-question/44264/3 "2015-06-16T18:39:16Z")

</div>

Thanks a lot! That did the trick. The only thing I had to change was remove the searchStr= as it was giving me a syntax error when entering the irule.

Final irule looked like this.

when HTTP\_REQUEST { if { [HTTP::uri] start\_with “/path/path/peoplefinder\_advanced.pl” } { HTTP::redirect “[http://newsite.com/peoplefinder.aspx?](http://newsite.com/peoplefinder.aspx?)[URI::query [HTTP::uri]]” } }
