Forum Discussion

mawan_revera's avatar
mawan_revera
Icon for Altostratus rankAltostratus
Oct 06, 2019

policy and irule multiple redirect not allowed

Hi - i have a Question -

i have a policy that does a redirect - meaning if URI path is / redirect to /abc

for maintenance window i have a i rule that detects time and should redirect to a maintenance page

but the rule gives "Multiple redirect/respond invocations not allowed" -- how can i resolve this - meaning execute this irule

 

 

set static::start_date "2019-05-05 10:09"

 set static::end_date "2019-05-05 10:10"

 set static::start [clock scan $static::start_date]

 set static::end [clock scan $static::end_date] 

}

 when HTTP_REQUEST timing on { 

 set now [clock seconds] 

 if { not [class match [IP::client_addr] equals private_net] } {

 if {$now > $static::start and $now < $static::end}{ 

 

 HTTP::redirect "http://mytedirect-maintenance"

3 Replies

  • Hi mawan_revera

    You can add /abc redirect to iRule.

    if {$now > $static::start and $now < $static::end} {
    	if { not [class match [IP::client_addr] equals private_net] } {
    		HTTP::redirect "http://mytedirect-maintenance"
    	}
    } else {
    	if { [HTTP::uri] equals "/" } {
    		HTTP::redirect "http://[HTTP::host]/abc"
    	}
    }
  • hi -

    Thanks for the response -

    that would mean - i would have to remove the policy

    meaning

    the policy gets executed - and when it gets to the irule - i get an error and nothing happens

    adding the redirect to the irule would not help with that

     

    i want to keep the policy and find a way to have a maintenance window redirect

  • i figured it out -- did if statement before the - maintenance page to do a redirect to /abc and then - redirect to maintenance page

    • thanks for helping