Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
code share

Disable APM rewrite for specicfic URI and redirect to external website

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.

Tested on Version:
Comments on this Snippet
Comment made 04-Jul-2017 by Habib Ulla Khan 274

This doesnt work..

Comment made 05-Jul-2017 by Ali Khan 57

Hi Habib,

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

Comment made 05-Jul-2017 by Habib Ulla Khan 274

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.

Comment made 06-Jul-2017 by Stanislas Piron 10481


Here is a more generic version of this irule

    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