Forum Discussion

ORYX_GTL_197857's avatar
ORYX_GTL_197857
Icon for Nimbostratus rankNimbostratus
Mar 22, 2018

iRule: multiple URI redirection

Hi..

 

I need to do the redirect for HTTPS traffic based on URI contains. I followed working iRule (two pools) and did modifications below but it's giving an error please any help is highly appreciated.

 

Working iRule

when HTTP_REQUEST { if { [HTTP::uri] contains "prod" } { pool prod_pool } else { pool default_pool } }

 

Modified iRule but not working

when HTTP_REQUEST { if { [HTTP::uri] contains "prod" } { pool prod_pool } if { [HTTP::uri] contains "dev" } { pool dev_Pool } else { pool default_pool } }

 

  • JG's avatar
    JG
    Icon for Cumulonimbus rankCumulonimbus
    when HTTP_REQUEST { 
        if { [HTTP::uri] contains "prod" } { 
            pool prod_pool 
        } elseif { [HTTP::uri] contains "dev" } { 
            pool dev_Pool 
        } else { 
            pool default_pool
        }
    }
    

    However, "contains" sounds a bit too broad to me.