Help with reverse proxy config

Sep 8, 2009 at 7:12 PM

Hi,

First of all, thanks for the your great effort on putting this up, if I get it to work as I want it to it will save me loads of time!

I'm having problems on the configuration itself. I guess this question is not really about the URL Rewriter but more about the configuration syntax.

Here's the scenario. I have multiple language sites running on one server, for instance:
http://www.company.com (english)
http://www.company.fr (french)
http://www.company.com.mx (Latin America spanish)

etc

I am now trying to configure it so that if I go to www.company.ca, the following happens:

1. I get forwarded by default to www.company.ca/en
2. The contents of www.company.com gets reverse proxied to www.company.ca/en
3. If the user types (or selects from a drop down) to see the site in French, then the URL would be www.company.ca/fr, and the content of www.company.fr gets reverse-proxied to this page.
4. If I click any link on this page, it gets correctly proxied, i.e., a link on the page would be to /something.html, it should show as /en/something.html (it's OK if the source still shows /something.html, I just need the actual URL shown on the site to be /en/something.html)

I got the reverse proxying to work, with a very simple rule. I am having trouble on the default forwarding from / to /en, and on resolving the subsequent URLs.

Probably I'm way off course by trying to use URL Rewriter for this scenario, but really wanted to save myself the trouble of having to write my own module and handlers.

Any help is highly appreciated!

TIA,

Nuno

Coordinator
Sep 9, 2009 at 3:45 AM

Try something like this

 

RewriteCond %{HTTP_HOST}  ^www.company.ca$  [NC]
RewriteRule ^/en(.*)$  http://www.company.com$1 [NC,P]

 

And then do the same for the french site.  Now I cannot gartontee that the Reverse Proxy is going to pick up all your styles, images, and scripts, especially in this case if you are using absolute paths.  You may have to map those resources individually.