Forum Discussion
Singh_74932
Nimbostratus
May 01, 2008302 to 301
I want to write an iRule which will :
If ( the response from webserver is 302 )
Then
convert it to 301 and insert the location of the redirected URL)
Usi...
hoolio
Cirrostratus
May 01, 2008Hi Raj,
This example should do just that. If there is other info you need to include in the rewritten redirect, you can add it as an additional header or content. See the HTTP::respond wiki page (Click here) for details.
when HTTP_RESPONSE {
Check if the server response is a 302
if {[HTTP::status] == 302}{
Send a 301 response to the client with the Location header value from the server's response
HTTP::respond 301 Location [HTTP::header value Location]
}
}
Aaron
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