# HTTP Post - Redirect

**URL:** <https://community.f5.com/t/http-post-redirect/56881>\
**Category:** Technical Forums\
**Tags:** irules, ltm, application-delivery\
**Created:** [July 25, 2017, 5:05pm UTC](https://community.f5.com/t/http-post-redirect/56881 "2017-07-25T17:05:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PSPK](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@PSPK](https://community.f5.com/u/PSPK)\
**Post date:** [July 25, 2017, 5:05pm UTC](https://community.f5.com/t/http-post-redirect/56881/1 "2017-07-25T17:05:20Z")

</div>

I have a client(browser) requesting an HTTP post request to a VIP-1.

This POST request should be redirected to VIP-2 with the help of an irule.

Can this is be done?

Please help

---

<div class="post-metadata">

**Author:** ![VernonWells](https://avatars.discourse-cdn.com/v4/letter/v/dec6dc/32.png) [@VernonWells](https://community.f5.com/u/VernonWells)\
**Post date:** [July 25, 2017, 9:09pm UTC](https://community.f5.com/t/http-post-redirect/56881/2 "2017-07-25T21:09:35Z")

</div>

Do you want an explicit redirect, where an HTTP 3xx response is sent back to the client, or do you want to transparently forward from one Virtual Server to a different Virtual Server?

---

<div class="post-metadata">

**Author:** ![Brad\_Parker](https://avatars.discourse-cdn.com/v4/letter/b/a87d85/32.png) [@Brad\_Parker](https://community.f5.com/u/Brad_Parker)\
**Post date:** [July 26, 2017, 3:27pm UTC](https://community.f5.com/t/http-post-redirect/56881/3 "2017-07-26T15:27:57Z")

</div>

You can use a response code 307 for that, i.e.

```tcl
when HTTP_REQUEST {
    if {}{
        HTTP::respond 307 noserver Location "https://your.new.location/page"
    }
}

```

---

<div class="post-metadata">

**Author:** ![Jad\_Tabbara\_J1](https://avatars.discourse-cdn.com/v4/letter/j/2acd7d/32.png) [@Jad\_Tabbara\_J1](https://community.f5.com/u/Jad_Tabbara_J1)\
**Post date:** [July 26, 2017, 4:24pm UTC](https://community.f5.com/t/http-post-redirect/56881/4 "2017-07-26T16:24:33Z")

</div>

Hello PSPK,

Try this irule. Apply it to VIP 1

```tcl
when HTTP_REQUEST {

    First identify the POST you may add more condition to identify your particular POST 
    if { [string tolower [HTTP::method]] eq "post" } {
        Redirect the post to the other VS, replace vs-name-vip2 by the VIP 2 VS name         
        virtual vs-name-vip2
    }
}

```
