Web Servers on Unix and Linux - mod_rewrite w/proxy to different domain on same physical server

This is Interesting: Free IT Magazines  
Home > Archive > Web Servers on Unix and Linux > June 2006 > mod_rewrite w/proxy to different domain on same physical server





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author mod_rewrite w/proxy to different domain on same physical server
BeanDog@gmail.com

2006-06-27, 7:16 pm

I have two domains hosted on the same physical server (call them
www.thisdomain.com and www.otherdomain.com). I do not have access to
the actual server machine, so I can only make changes to settings that
are local to each account.

Here is a simplified excerpt from a .htaccess on www.thisdomain.com:

RewriteEngine on
RewriteBase /
RewriteRule ^((.*)/)?([^\./]*)\.htm(l)?
http://www.otherdomain.com/master.p...123;REQUEST_URI}&Server=%{SERVER_NAME}
[P]

The user requests a .htm page from thisdomain.com, which is served up
dynamically from a php script on otherdomain.com. The RewriteRule is
an error, though, since the [P] (proxy) attribute is not valid on rules
redirecting to the same server. If I remove the [P] flag, it sort of
works, but the user sees the mangled URL and relative hyperlinks are
ruined. If I leave the [P] flag in, I get a 404 error.

This works perfectly as written when hosted on a separate server. For
instance, an Apache server running on my local computer works just as I
expected. So I assume the problem is that the two accounts are hosted
on the same server. Someone suggested that I redirect to a local
filename, but the user account for thisdomain.com has no access
privileges for the file on otherdomain.com.

Any hints?



~BenDilts( void );

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com