Forum Discussion
How to check for If not Redirect?
Kevin and Michael, Thanks for your response.
But it sounds like there is no better way if the request if a direct request or as a result of Redirect. I have tried below script and the result seems to be same(see below):
when HTTP_RESPONSE {
if { [HTTP::is_redirect] } {set a 1} if { [HTTP::header is_redirect] } {set b 1} if { [HTTP::header exists Location] } {set c 1}
if { not ([HTTP::is_redirect]) } {set a 0} if { not ([HTTP::header is_redirect]) } {set b 0} if { not ([HTTP::header exists Location]) } {set c 0}
set x [HTTP::is_redirect] set y [HTTP::header is_redirect] set z [HTTP::header exists Location]
set result [format "x=%s y=%s z=%s a=%s b=%s c=%s" $x $y $z $a $b $c]
HTTP::respond 200 content $result
}
RESULT: in any case the result is same as below! x=0 y=0 z=0 a=0 b=0 c=0
So I am just not sure if any of these conditions are working.
The redirection is trigger from another rule as below where myDNS is substituted: HTTP::respond 302 noserver Location "https://$uri"
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