[thelist] URL Rewrite Between Two Doamins

Maximillian Schwanekamp lists at neptunewebworks.com
Mon Jun 20 01:10:32 CDT 2005


Ron Dorman wrote:
> I have a Linux/Apache/php/MySQL platform.
> I need to have *domainB.com* be able to run *app.domainA.com* and look
> like it is running *app.domainB.com* in the address bar and all other
> references to the browser window/object.

Do you have access to httpd.conf?  If so, you can have app.domainB.com's
DocumentRoot set to the same as app.domainA.com.  e.g.:
<VirtualHost 192.168.1.1>
ServerName app.domainb.com
ServerAdmin admin at domainb.com
DocumentRoot /home/domaina/public_html/app
User domaina
Group domaina
</VirtualHost>

That is, for app.domainb.com which resolves to 192.168.1.1, set
DocumentRoot to domaina/public_html/app (i.e. domainA.com/app), and run
with the credentials of user domaina.  This is assuming you already have
things set up for app.domaina.com and have DNS already configured for
app.domainb.com to resolve correctly. You might also want to set the
ErrorLog directive too!  Don't forget to restart or reload Apache when
you make the change.

Maybe someone else will have a more elegant solution, but this ought to
do what you're after...if you have access to httpd.conf.

If *not*, we'll probably need some more info.  My question in this case
is whether domainA and domainB are running under different user/groups?
 If domainB has read/execute permissions on domainA's /app directory, a
mod_rewrite solution could work.

-- 
Maximillian Von Schwanekamp
http://www.neptunewebworks.com/



More information about the thelist mailing list