# URL redirect looses POST data

**URL:** <https://community.f5.com/t/url-redirect-looses-post-data/31497>\
**Category:** Technical Forums\
**Tags:** irules, devops, application-delivery\
**Created:** [September 10, 2013, 5:53am UTC](https://community.f5.com/t/url-redirect-looses-post-data/31497 "2013-09-10T05:53:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Godfrey\_69235](https://avatars.discourse-cdn.com/v4/letter/g/ee59a6/32.png) [@Godfrey\_69235](https://community.f5.com/u/Godfrey_69235)\
**Post date:** [September 10, 2013, 5:53am UTC](https://community.f5.com/t/url-redirect-looses-post-data/31497/1 "2013-09-10T05:53:13Z")

</div>

What do i need to preserve post data in HTTP URI redirect?

Addition:

when HTTP\_REQUEST { We would like to check if our https request is applicable for the requested page

```tcl
if {[HTTP::uri] starts_with "/n/" } {

                HTTP::redirect "http://[HTTP::host][HTTP::uri]"

            }

```

}

---

<div class="post-metadata">

**Author:** ![nathe](https://avatars.discourse-cdn.com/v4/letter/n/eb8c5e/32.png) [@nathe](https://community.f5.com/u/nathe)\
**Post date:** [September 10, 2013, 6:54am UTC](https://community.f5.com/t/url-redirect-looses-post-data/31497/2 "2013-09-10T06:54:23Z")

</div>

Godfrey, a redirect will issue a http status 302 and a Get request to the new uri (rather than the original Post). Try HTTP:: respond using a 307 status code. This will maintain the original request type. Plenty of examples on DC. Hope this helps. N

---

<div class="post-metadata">

**Author:** ![JG](https://avatars.discourse-cdn.com/v4/letter/j/dfb087/32.png) [@JG](https://community.f5.com/u/JG)\
**Post date:** [September 10, 2013, 7:12am UTC](https://community.f5.com/t/url-redirect-looses-post-data/31497/3 "2013-09-10T07:12:54Z")

</div>

Many browsers will not behave the same way on receiving a 307. Depending on how badly you want this, it is possible to get your irule to parse the POST body, and return a 200 page that contains a new, pre-filled “form” that the user can re-submit to the new location.

---

<div class="post-metadata">

**Author:** ![Godfrey\_69235](https://avatars.discourse-cdn.com/v4/letter/g/ee59a6/32.png) [@Godfrey\_69235](https://community.f5.com/u/Godfrey_69235)\
**Post date:** [September 24, 2013, 9:50am UTC](https://community.f5.com/t/url-redirect-looses-post-data/31497/4 "2013-09-24T09:50:24Z")

</div>

Thank you Jie and Nathan. Just an addition. I am looking at performing SSL termination from F5. There are pages that are required to be in HTTPS and others HTTP. Whenever i apply HTTP to HTTPS redirect iRule and to the HTTP VS pool, it works fine, but if i request for a non-HTTPS page, it sticks with SSL (HTTPS)

---

<div class="post-metadata">

**Author:** ![boneyard](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/boneyard/32/20419_2.png) [@boneyard](https://community.f5.com/u/boneyard)\
**Post date:** [September 25, 2013, 5:40pm UTC](https://community.f5.com/t/url-redirect-looses-post-data/31497/5 "2013-09-25T17:40:53Z")

</div>

if this is a new question just make a new question for it, now it becomes quite unclear if you are trying to combine things or not. if you are please post the full new irule.
