Forum Discussion

Eric_Brander_27's avatar
Eric_Brander_27
Icon for Nimbostratus rankNimbostratus
Sep 09, 2011

Having trouble what what should be a "basic" URI rewrite

This should be simple but I can't figure it out.

 

 

I want any request directly to "https://www.abc.com/" to redirect to "https://www.abc.com/pathto/portalapplication/"

 

 

In several hours of research I came up with this:

 

 

when HTTP_REQUEST {

 

if { [HTTP::uri] equals "/" }

 

{HTTP::uri {/pathto/portalapplication/}

 

}

 

}

 

 

Which doesn't seem to work. Can you offer any suggestions?

 

 

TIA,

 

 

Eric

 

  • [root@Edelweiss:Active] config  b virtual bar list
    virtual bar {
       destination 172.28.17.17:https
       ip protocol tcp
       rules myrule
       profiles {
          clientssl {
             clientside
          }
          http {}
          tcp {}
       }
    }
    [root@Edelweiss:Active] config  b rule myrule list
    rule myrule {
       when HTTP_REQUEST {
       if {[HTTP::uri] equals "/"} {
          HTTP::redirect https://[HTTP::host]/pathto/portalapplication/
       }
    }
    }
    
    [root@Edelweiss:Active] config  curl -Ik https://www.abc.com
    HTTP/1.0 302 Found
    Location: https://www.abc.com/pathto/portalapplication/
    Server: BigIP
    Connection: Keep-Alive
    Content-Length: 0