Forum Discussion

destr0yr_22001's avatar
destr0yr_22001
Icon for Nimbostratus rankNimbostratus
Jun 23, 2012

to redirect, proxy, irule or suggest something else

Hi.

I have a request to serve various content from a different pool for our site to help transition to new cms. Basically:

 

 

 

http://www.abc.com/ -> http://www2.abc.com/

 

http://www.abc.com/de -> http://www2.abc.com/de

 

http://www.abc.com/fr -> http://www2.abc.com/fr

 

http://www.abc.com/es -> http://www2.abc.com/es

 

http://www.abc.com/pt -> http://www2.abc.com/pt

 

 

 

 

The dev has expressed that they want an exact equal match of "/" or "/de", etc., to pull from the pool that serves content for www2 (varnish cluster that fronts a cms). They do not want www2 to be apparent to the end-user.

 

 

 

I've tried a couple things (to test with only "/" at first):

 

 

 

when HTTP_REQUEST {

 

if { [HTTP::host] eq "www.abc.com"} {

 

if { [HTTP::path] starts_with "/" } {

 

pool pool-www2.abc.com

 

}

 

}

 

}

 

 

 

 

Or:

 

 

 

when HTTP_REQUEST {

 

if { [HTTP::host] eq "www.abc.com"} {

 

switch [HTTP::uri] {

 

"/" -

 

"/index.php" -

 

"/pt/" -

 

"/de/" -

 

"/fr/" -

 

"/es/" -

 

"/pt/index.php" -

 

"/de/index.php" -

 

"/fr/index.php" -

 

"/es/index.php"

 

{

 

pool pool-www2.abc.com

 

}

 

}

 

}

 

}

 

 

 

 

There are number of other urls, such as /foo, /meh, /bar (and language urls, i.e. /pt/foo/, /pt/meh, /pt/bar/) they do not want "redirected", only the main page for each language. Any thoughts/suggestions? not even sure this is possible or sane :)

 

 

1 Reply

  • You probably want to look into Transparent Header Modifications/Redirects.

     

     

    Joe did a nice write up of this back in 2008, but it all still applies of course. Take a look at this article and look at the comments section below it. Joe talks specifically about modifying the hostname and or the URI and provides examples:

     

     

    https://devcentral.f5.com/weblogs/Joe/archive/2005/07/27/ModifyingUriWithoutRedirect.aspx