Forum Discussion
John_Alam_45640
Historic F5 Account
Append a parameter to the Location header like this:
when HTTP_RESPONSE {
If { [HTTP::is_redirect] } {
HTTP::header replace Location "[HTTP::header Location]?type=redirected"
}
}
See this: https://devcentral.f5.com/wiki/iRules.http__is_redirect.ashx
If there are already some parameters in the location header then use this instead:
HTTP::header replace Location "[HTTP::header Location]&type=redirected"
Rajesh_A_142089
Jan 28, 2014Nimbostratus
Thank you John. Following your advise, I have following in my RESPONSE event where I needed to redirect the response somewhere temporarily (302) and also this is where I wanted to indicate in the redirect that it is redirect.. The result is that redirect happens but I do not see the query string in my redirect.. Please advise....Am I embading the header appropriately?
when HTTP_RESPONSE {
if { $is_sourcehost and [HTTP::status] == 404 } {
HTTP::header replace Location "[HTTP::header Location]?type=redirected"
HTTP::respond 302 noserver Location "https://temlocation.mydomain.com$uri"
}
}