Forum Discussion

Brian_Kinsey_10's avatar
Brian_Kinsey_10
Icon for Nimbostratus rankNimbostratus
Nov 15, 2007

Redirect using part of origional URL

I would like to set up a rule that redirects a request such as to http://client1.company.com to http://www.company.com/client1

 

 

I know I can do it like this:

 

 

when HTTP_REQUEST {

 

if { ([string tolower [HTTP::host]] equals "client1.company.com")

 

} {

 

HTTP::redirect "http://www.company.com/client1"

 

}

 

}

 

 

But there may be quite a few clients that I need to add to this rule. Is there a way to put whatever is before the .company.com in a variable and redirect to www.company.com/variable_value?