CodeShare
Have some code. Share some code.
cancel
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner
Ali_Khan
Nimbostratus
Nimbostratus

Problem this snippet solves:

This will disable APM for a specific URI (HEX mangled APM URI) and redirect user to the original address of the website.

Code :

when HTTP_REQUEST { 
if { [HTTP::uri] contains "123456789012345678962789346$$/mycompany" } { 
ACCESS::disable 
HTTP::redirect "https://test.mycompany.com/mycompany" 
} 
}

Tested this on version:

11.5
Comments
Habib_Ulla_Khan
Nimbostratus
Nimbostratus

This doesnt work..

 

Ali_Khan
Nimbostratus
Nimbostratus

Hi Habib,

 

Can you give details of your scenario and what doesn't work?

 

Habib_Ulla_Khan
Nimbostratus
Nimbostratus

I have a VIP with access policy. I am using below irule and doesnt work.

 

when HTTP_REQUEST { if { [string tolower [HTTP::uri]] starts_with "/" } { ACCESS::disable HTTP::redirect "https://[HTTP::host]/WorkFlowUI/Home.aspx" } }

 

I want to disable APM and redirect. APM will need to enabled only when a specific uri is requested.

 

Stanislas_Piro2
Cumulonimbus
Cumulonimbus

Hi,

Here is a more generic version of this irule

when HTTP_REQUEST {
    if {[scan [HTTP::uri] {/f5-w-%[^$]$$%s} encressource uri] > 1} {
        set ressource [binary format H* $encressource]
        switch -- [URI::host $ressource] {
            "www.google.com" -
            "www.youtube.com" -
            "test3.mycompany.com" {  
                HTTP::respond 302 Location $ressource$uri 
            }
        }
    }
}
Version history
Last update:
‎07-Jun-2016 07:05
Updated by:
Contributors