Forum Discussion

configt_17313's avatar
configt_17313
Icon for Nimbostratus rankNimbostratus
Oct 29, 2012

Irule assistance: redirect or pool

Need a quick Irule that will redirect based on a specific URL, if that does not match then use a pool.

 

This was my first attempt, I do not have a way to test this until we cutover so I wanted to verify syntax first. Thanks

 

 

when HTTP_REQUEST {

 

"www.testurl.com"

 

HTTP::redirect "https://[HTTP::host][HTTP::uri]"

 

else

 

pool pool1

 

}

 

 

 

3 Replies

  • Can you try this?

    
    when HTTP_REQUEST { 
    if { [string tolower [HTTP::host]] eq "www.testurl.com"]}{
    HTTP::redirect "https://[HTTP::host][HTTP::uri]" 
    } else {
    pool pool1
    }
    }
    

    You could create a test virtual server and put a hosts file entry in a client for www.testurl.com to point to the test virtual server.

    Aaron