Forum Discussion

Albert_252822's avatar
Albert_252822
Icon for Nimbostratus rankNimbostratus
Jun 14, 2016

Several Redirect URLs after blocking?

Hi all,

 

I have different web applications in each Virtual Server and as I have to match ASM Policies to Virtual Servers I only can have a redirect URL for different web applications.

 

Is it possible to have more than one unique Redirect URL for each ASM Policy? Could I redirect to different URLs depending on the Local Traffic Policy? What alternatives do I have?

 

Thanks in advance.

 

2 Replies

  • here is an example

    when HTTP_REQUEST {
        set needredirect 0
        set requri [HTTP::uri]
    }
    when ASM_REQUEST_BLOCKING {
        log local0. "asm blocking" 
        set needredirect 1
    }
    
    when HTTP_RESPONSE_RELEASE {
        if { $needredirect } {
    
            switch -glob $requri {
                /application1* { HTTP::respond 302 Location "http://www.domain.com/application1/index" }
                /application2* { HTTP::respond 302 Location "http://www.domain.com/application2/index" }
            default { }
            }
        }
    }