For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

harshads_204995's avatar
harshads_204995
Icon for Nimbostratus rankNimbostratus
Aug 11, 2015

Strange redirection

I'm facing a weird issue - we have two websites (managed through an iRule) under the same HTTPS VIP: https://www.somedomain.com/abc and https://www.somedomain.com/def

 

Suppose I browse to https://www.somedomain.com/abc - the /abc site comes up fine. Now if I browse to https://www.somedomain.com/def, the browser gets redirected to https://www.somedomain.com/abc

 

I cleared my browser cache and tried browsing to https://www.somedomain.com/def, the /def site came up fine. But now on browsing to the /abc site, I'm getting redirected back to /def!!

 

My iRule looks correct (ordering, syntax, etc) and so does the VIP (as far as I can tell). I'm sure the web servers themselves aren't causing the redirection as the issue doesnt happen if i browse the sites locally on the servers.

 

Any ideas ? I'm using BIG-IP 11.6.0 Build 4.0.420 Hotfix HF4

 

Thanks!

 

5 Replies

  • The irule looks like this:

    when HTTP_REQUEST {
    set uri [string tolower [HTTP::uri]]
    if { $uri starts_with "/someuri" } {use pool pSomePool}
    elseif { $uri starts_with "/abc" } {use pool pABC}
    elseif { $uri starts_with "/def"} {pool pDEF}
    elseif { $uri starts_with "/someotheruri" } {use pool pSomeOtherPool}
    }
    
    • harshads_204995's avatar
      harshads_204995
      Icon for Nimbostratus rankNimbostratus
      Also wanted to note that there is no default pool defined on the VIP. Requests are directed to the pools based only on the iRule. Default persistence profile is cookie persistence.
  • Hi,

    the irule should work. switch command is better than multiple "elseif", but it should work.

    try this irule :

    when HTTP_REQUEST {
        switch -glob [string tolower [HTTP::path]] {
            "/someuri*" {use pool pSomePool}
            "/abc*" {use pool pABC}
            "/def*" {pool pDEF}
            "/someotheruri*" {use pool pSomeOtherPool}
            default {
                HTTP::respond 404 content {
                    
                       
                          URL Error
                       
                       
                          This URL does not exist on this server
                       
                    
                 } noserver
            }
        }
    }