Forum Discussion
URL redirect looses POST data
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
if {[HTTP::uri] starts_with "/n/" } {
HTTP::redirect "http://[HTTP::host][HTTP::uri]"
}
}
4 Replies
- nathe
Cirrocumulus
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
- JG
Cumulonimbus
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.
- Godfrey_69235
Nimbostratus
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) - 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.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com