Forum Moderators: phranque
I am trying to find a way to point a domain's root to a subdirectory in a different domain.
For example, I want to pull files for [domainXYZ.com...] from [alt-domain.com...]
so, if someone went to [domainXYZ.com...] it would actually pull data from [alt-domain.com...]
I have seen this done before, but I am unable to find out how. Has someone seen a tutorial on how to do this?
I used to think it was achievable through an advanced DNS edit, however, it looks like it takes a configured .htaccess file.
Thank you,
Leo
Welcome to WebmasterWorld!
Are the two domains hosted on the same machine?
If so, are they hosted in the same "account" on that machine... that is, are they sharing filespace?
In some cases, you can set up symlinks if they're on the same machine. In other cases, and when the domains are on separate machines, you'll probably need to use Apache mod_proxy.
Jim
First, let me say that I am very excited that I found these forums. If it proves to be an asset (which I hope and think it will be), I definitely plan on becoming a supporting member.
OK, so here is the deal. Ultimately, I kneed this to work with the most flexibility as possible... different server, different accounts, same server, same account, etc. My guess is that this takes the most 'custom' work and is the most technically detailed?
In this instance, the websites are on different machines (same collocation space and network though). I would like all the customizations to be done on the 'forwarding' domain, and none on the 'accepting' domain (if possible).
The reason I want this done, is because the main machine hosts an application in which the customers data is stored on "http://www.application-server.com/customer/" but the individual websites are on a different server (which handles that customers mail, DNS, etc -- its a plesk server). So I am looking for the ability to create the "http://www.customer.com/" domains which pull the actual data from "http://www.application-server.com/customer/" with it still looking like the site is branded to the customer (the customer.com URL).
So it looks like I would need to use that mod_proxy you mentioned... is this something easy to do?
Thank you,
Leo
I believe that the major part of your goal can be achieved through the use of mod_proxy and mod_rewrite, specifically, the [P] flag used with the RewriteRule directive. I suggest you try it on one test machine set up to look like a "customer" machine, and explore all the consequences to make sure that's what you want and need.
Dig into the Apache documentation [httpd.apache.org] and see if this sounds like what you want to do.
Jim