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)
Using 9.x
Any help will be much appreciated.
Thanks
Raj
- hoolio
Cirrostratus
Hi Raj,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] } }
- Singh_74932
Nimbostratus
Got it .. but one thing is this 9.x dependent or we can do it in 4.x too ? - Nicolas_Menant
Employee
Hi, - hoolio
Cirrostratus
Also, in 4.x there isn't an option to check the response status or modify the response sent to the client. You can only issue redirects or specify a pool based on request criteria. - Singh_74932
Nimbostratus
u guys rock !! .. - Colin_Walker_12Historic F5 AccountThe issue is that with 4.x there is no way to check the traffic coming back from the client. You really need the full-proxy architecture of the 9.x systems to make something like this work.
- hoolio
Cirrostratus
There is an issue with trying to send a response twice in the same response from an iRule using either HTTP::respond or HTTP::redirect. This issue wouldn't affect your ability to send a redirect after the pool member has responded with a redirect.
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