Forum Discussion

Matt_108113's avatar
Matt_108113
Icon for Nimbostratus rankNimbostratus
Jul 15, 2009

Using Irules to mimic apache Virtual hosts

I would like to use I rules to mimic Apache Virtual Hosts.

 

 

I have a web server that has a bunch of sites on it and instead of setting up virtual hosts on Apache I wanted to see if I could do this with Irules.

 

 

Basically when someone hits the site and requests http://webserver1.domain.com/SITE1 they would be redirected to.

 

 

http://SITE1.domain.com in the browser.

 

 

there are multiple sites and they are added all the time so if I could get something generic like.

 

 

when HTTP_REQUEST {

 

if { [HTTP::uri] contains "/SITE1" }{

 

HTTP::redirect http://site1.domain.com}

 

}

 

 

Is kind of the idea, but how to I make the F5 aware that site1 is on the webserver at http://webserver1.domain.com/SITE1?

 

 

The problem is I don't know syntactically what needs to be were to do this.

 

 

Any help would be appreciated.