Rewrite & mod_proxy

New to mod_rewrite? This is a good place to start.

Rewrite & mod_proxy

Postby tclick » Wed Aug 28, 2002 5:49 am

I swear this looks simple but I just can't figure it out...

Problem:
Requests to http://www.somehost.com/bugs should go to http://192.168.100.19:8080/
Requests to http://www.somehost.com/foo should go to http://192.168.100.20:5000/
All other requests should be handled as normal.

What I have so far is:

ProxyPass /bugs/ http://192.168.100.19:8080/
ProxyPass /foo/ http://192.168.100.20:5000/
ProxyPassReverse /bugs/ http://192.168.100.19:8080/
ProxyPassReverse /foo/ http://192.168.100.20:5000/

That mostly works. My problem is the /bugs/ site has .jsp, .css, and .gif references which are being looked for on the local site.

I added the following:

RewriteEngine on
RewriteRule ^(.*)\.jsp$ /bugs/$1.jsp [P]

Which makes the .jsp run (an I can add appropriate entries for .css and .gif), the trouble is I run .jsp on the local machine also and this rewrites all the .jsp references.

So my question is how do I make that conditional?

BTW, I have tried this (which didn't work):

RewriteEngine on
RewriteCond %{REQUEST_URI} ^/bugs/.*
RewriteRule ^(.*)\.jsp$ /bugs/$1.jsp [P]

TIA

-Tony
tclick
 

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 15 guests

cron