Forum Discussion

Misty_Spillers's avatar
Icon for Nimbostratus rankNimbostratus
Oct 04, 2011

Omiting a portion of a redirect

This seems like it would be easy but just can't quite find the answer.



One of our customers used to be hosted under our main web site now they have moved the site to a vanity domain. I'm trying to redirect possible book marks to the old site but I need to omit part of the uri.



So they want to go to



The way I normally do this is: (this is in a long rule handling other stuff as well so that's why it not properly formatted)




if { [string tolower [HTTP::host]] contains "" and [string tolower [HTTP::uri]] starts_with "/theirsite" } {


HTTP::redirect "[HTTP::uri]"


} else {



But it ends up



any easy way to omit the /theirsite?





3 Replies

  • URI::path




  • sorry i think this may be easier.

    [root@tulip:Active] config  b virtual bar list
    virtual bar {
       ip protocol tcp
       rules myrule
    [root@tulip:Active] config  b rule myrule list
    rule myrule {
       when HTTP_REQUEST {
       if {[string tolower [HTTP::host]] ends_with "" and [string tolower [HTTP::uri]] starts_with "/theirsite"} {
          HTTP::redirect "[string range [HTTP::uri] 10 end]"
    [root@tulip:Active] config  curl -I
    HTTP/1.0 302 Found
    Server: BigIP
    Connection: Keep-Alive
    Content-Length: 0