"Mirror" a site under additional domain

Using a single web hosting account to host multiple sites

"Mirror" a site under additional domain

Postby hm78 » Sun Apr 12, 2009 2:05 pm

I've got a site at cooking.example.com, run by a CMS.
Now I want to use the domain cooking.tld for this site (in addition).

My shared hoster does not allow me to point the domain to a folder / use DNS / A records (or whatever you call all this stuff) at his configuration backend.
So all I can do is to deposit a .htaccess at cooking.tld and/or cooking.example.com.

What I want:

when visitors call cooking.tld/about-me, the server should look for cooking.example.com/about-me and display it -- while cooking.tld/about-me has to be still visible in the browsers address bar.

Is this possible?
If yes, is it recommendable?

If it is not possible (or: recommendable), could ("should") I transfer cooking.tld to a "real" domain provider? Would it then be possible to point this domain to my site at cooking.example.com and let it "mirror" everything?
hm78
 
Posts: 17
Joined: Sun Mar 04, 2007 8:26 pm

Postby richardk » Mon Apr 13, 2009 1:24 pm

I've got a site at cooking.example.com, run by a CMS.

Is it a CMS that you installed (or could install at a different provider) or something custom to this hosting provider?

My shared hoster does not allow me to point the domain to a folder / use DNS / A records (or whatever you call all this stuff) at his configuration backend.

...

If it is not possible (or: recommendable), could ("should") I transfer cooking.tld to a "real" domain provider?

Does you hosting provider control the cooking.tld domain? Did you register it with/through them?

Is this possible?

Probably/yes.

You might need do have cooking.tld go to a server and then use mod_rewrite/mod_proxy proxy the request to the cooking.example.com server. Or you might need to find a different hosting provider.

If yes, is it recommendable?

It depends.

Why do you want two addresses? Wouldn't redirecting to one address be better?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby hm78 » Mon Apr 13, 2009 1:55 pm

richardk wrote:
I've got a site at cooking.example.com, run by a CMS.

Is it a CMS that you installed (or could install at a different provider) or something custom to this hosting provider?


It's a CMS I installed: Drupal.
I use the multi-site feature of it. So Drupal is installed at example.com. There I can create subfolders (like cooking.example.com, sports.example.com, ...) which are new sites which share the same code base. After creating a new sub-site folder, I have to create the appropriate subdomain at my hosters configuration backend. And I have to set the subdomain to point to the main folder, where Drupal is installed (example.com),

Now, I could point the domain cooking.tld to this Drupal installation folder and everything would be fine. But my problem is: I can't, because both domains (example.com and cooking.tld) need to be managed by the same hosting sub account, which is not the case.

Does you hosting provider control the cooking.tld domain? Did you register it with/through them?


I registered both domains at the same shared hosting provider. They are managed at the same registered account (same server, one payment for both, ...), but on different sub accounts (which I created; each sub account has own login/password, own statistics, own email, and so on)


You might need do have cooking.tld go to a server and then use mod_rewrite/mod_proxy proxy the request to the cooking.example.com server. Or you might need to find a different hosting provider.


Is mod_proxy needed? I found an htaccess code where "[P]" was used, but it did not work. Seems that my hoster does not allow this. Can I check it anyhow?

And if I transfer the domain to a domain provider, how would it be possible to do what I want? What would be needed?

Why do you want two addresses? Wouldn't redirecting to one address be better?


It would be okay for me to use only one address (cooking.tld). But the problem is, that my CMS (Drupal) generates the URL of the other domain. I can't change this (would have to import/re-install several big sites; and besides that, I don't want to change the domain for all sites).
hm78
 
Posts: 17
Joined: Sun Mar 04, 2007 8:26 pm

Postby richardk » Tue Apr 14, 2009 7:18 am

Now, I could point the domain cooking.tld to this Drupal installation folder and everything would be fine. But my problem is: I can't, because both domains (example.com and cooking.tld) need to be managed by the same hosting sub account, which is not the case.

Your hoster can't do anything about that? They might be able to set up a symbolic link for you (from the cooking.tld document root to the example.com document root)or something similar. Do you not have an add-on domain option in example.com's sub account?

Is mod_proxy needed? I found an htaccess code where "[P]" was used, but it did not work. Seems that my hoster does not allow this. Can I check it anyhow?

It might be needed. To test you can use
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule example http://www.example.com/ [P,L]

Go to /example, it you see http://www.example.com/ it's working, if you don't it isn't.

And if I transfer the domain to a domain provider, how would it be possible to do what I want? What would be needed?

You don't need to transfer the domain. The problem is that you can't control the document root of the domain, not the DNS.
richardk
 
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 2 guests

cron