multiple domains and mod_proxy

Using a single web hosting account to host multiple sites

multiple domains and mod_proxy

Postby bshaurette » Thu Oct 09, 2008 3:14 pm

I'm doing some troubleshooting, and looking for general ideas as to what I should be looking for.

I've got several domains/vhosts, all hitting the same python app (on mod_python, apache 2.0.52). So, for example, the mapping should be something like this: => =>

And so on ...

I've got rewrite rules that appear to be working:

Code: Select all
    RewriteEngine on
    RewriteLog /blahblahblah/logs/my_rewrite.log
    RewriteLogLevel 9

    RewriteCond %{HTTP_HOST} ^domain1\.com [NC]
    RewriteRule ^/$ [P]

    RewriteCond %{HTTP_HOST} ^domain2\.com [NC]
    RewriteRule ^/$ [P]

They work perfectly on a local testing environment (OS X, also mod_python/apache 2.0.52). The problem comes when I move to our dev environment. I can see the proxy request in the rewrite log:

Code: Select all
(4) RewriteCond: input='' pattern='^domain1\.com' => matched
(2) rewrite / ->
(2) forcing proxy-throughput with
(1) go-ahead with proxy request proxy: [OK]

(4) RewriteCond: input='' pattern='^domain2\.com' => matched
(2) rewrite / ->
(2) forcing proxy-throughput with
(1) go-ahead with proxy request proxy: [OK]

But instead of the page I'm expecting, I get a big ol' 404.

So clearly the problem is the environment, not the mod_rewrite. What other things should I be looking at? mod_proxy is loaded ... I'm just not sure what else to look for.
Posts: 1
Joined: Thu Oct 09, 2008 3:13 pm
Location: San Francisco, CA

Postby richardk » Fri Oct 10, 2008 12:27 pm

Can you proxy to a different site, like Google?
Is it a 404 error from "" or the server with the mod_rewrite?
If you replace P with R does it redirect correctly?
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 4 guests