Forum Discussion
jondyke_46152
Nimbostratus
Oct 14, 2008Losing data on redirect irule
I am trying to do a redirect using an irule on one of my virtual servers. However the problem is that the original message is a post rather than a get so when it arrives at the redirected address it is missing the data.
The irule I am currently using is:-
when HTTP_REQUEST {
if {[HTTP::path] eq "/default.asp"}{
HTTP::redirect "http://devbis.assureweb.co.uk/QuoteServer/XMLQuoteserver/Receiver.aspx"
}
}
What can I do instead of a redirect to keep the data intact?
5 Replies
- hoolio
Cirrostratus
Hi Jon
Take a look at this post for some options:
http redirect - where's the payload (Click here)
Aaron - jondyke_46152
Nimbostratus
hmmmm...looks like a similar issue to the other chap only that the it is going to a different VIP. The post is originaly sent to http://publishdev.assureweb.co.uk/default.asp
publishdev.assureweb.co.uk resolves to a VIP
The post needs to be redirected to
http://devbis.assureweb.co.uk/QuoteServer/XMLQuoteserver/Receiver.aspx
devbis.assureweb.co.uk is a different VIP on the LTM. - hoolio
Cirrostratus
Would it work if you rewrote the response which generates the POST request to the correct resource? If so, you could use a stream profile and STREAM::expression iRule.
Or you could try using an iRule to rewrite the URI and select the other VIP's pool. This option might be easier, but more confusing for admin's to follow.
Aaron - jondyke_46152
Nimbostratus
Do you know of any examples of rewriting the URI and using another pool I can take a look at?
I think this one may be a bit out of my league.... - hoolio
Cirrostratus
To rewrite the URI in the request, you can use HTTP::uri "/new/uri". To rewrite the URI in a response header, you can use 'HTTP::header replace'. To replace content in the response payload, you can use a stream profile and STREAM::expression based iRule.
There are quite a few examples in this forum and the wiki pages for the various commands. If you have a more specific idea of what you want to rewrite and/or try something which doesn't work, reply here and we can give you more detailed suggestions.
HTTP::uri (Click here)
HTTP::header (Click here)
STREAM::expression (Click here)
pool (Click here)
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects