Forum Discussion

Ed_Ferrageau_67's avatar
Ed_Ferrageau_67
Icon for Nimbostratus rankNimbostratus
Feb 22, 2007

redirect of FQDN but not the rest

Hi,

 

My company want to publish a new website, http://www.companyname.com. The contents are hosted elsewhere. However, all other sites like http://www.companyname.com/countrywebsite are hosted internally. How can I tell in a rule that all traffic to "http://www.companyname.com" (and/or "http://www.companyname.com/" must be redirected to URL1 and the rest to URL2. I tried: if (http_uri == " ") but that doesn't work. Any help is highly appreciated. Https may not be redirected by the way.

 

Thanks.

 

Ed

1 Reply

  • Martin_Machacek's avatar
    Martin_Machacek
    Historic F5 Account
    Ed,

    following rule should work:

    
    if (http_uri == "/") {
       redirect to "http://" + http_host + ""
    }
    else {
       redirect to "http://" + http_host + ""
    }