How to park a domain on top of another?

wheatgrass

Verified User
Joined
Mar 31, 2006
Messages
16
I've been using DA for years but there doesn't seem to be a way as yet to park a domain on top of another within DA. Or am I missing something?

I want to park domain2.com on top of domain1.com, where domain1.com is a physical site with folders and files, while domain2.com isn't. When a user enters domain2.com in his browser, I want him to see the content from domain1.com but see domain2.com as the url in his browser and not domain1.com. Is this possible?
 
In DA that's called a "domain pointer" (with 'create as an alias' option enabled).
 
Thank you, Aspegic. I just tried the domain pointer with 'create as an alias' option enabled to park domain2.com on top of domain1.com. When I entered domain1.com, my browser said domain1.com (but of course). But when I entered domain2.com, my browser said domain1.com. How do I configure DA such that when I enter domain2.com, my browser would say domain2.com?
 
Sorry, I think I made a mistake. The problem was due to a rewrite statement.

BTW, is this domain pointing with 'create as an alias' option enabled considered a 301 or 302 redirect? How will the search engines handle domain2.com? E.g. will it index domain2.com by mistake and think that it is a different site from domain1.com?
 
Older searchengines would treat domain1 and domain2 as two separate different sites which just happen to have the same content. Modern searchengines however (google for example) have sofisticated duplicate content filters which can identify domain1 and domain2 as being the same site and will only index domain1.

301 and 302 redirects are very different from domainpointers.

Parking a domain on top of another domain (a domainpointer with alias in DA) works using a combination of 3 techniques. 1: An entry in the DNS zone that creates an A record for the second domain, 2: create a symbolic link for domain2 which points to domain1 in /etc/virtual, and 3: an entry in the VirtualHost section of domain1 in apache's httpd.conf which adds domain2 as a "ServerAlias" of domain1.

The first technique, an A record in the DNS zone, is easy to understand I think. It just binds domain2 to an IP address, which in the case of a domainpointer just happens to be the same IP address as that of domain1.

The second technique ensures that both domain1 and domain2 belong to the same user, count towards the same bandwidth limit, diskspace limit etc. etc.

The third technique may require a little bit more explanation.
There are 2 different ways you can instruct apache to serve multiple websites from a single server: IP based virtual hosting and Name based virtual hosting.

'IP based' was commonly used in the old days. Each website was assigned it's own unique IP address which enabled apache to know which website to serve based on the IP address. However, when IP addresses got in short supply, more and more providers started to use Name based virtual hosting.
'Name basted' hosting I think is the most commonly used method today. Many different websites can share the same IP address. Apache will decide which website to serve based on the domainname instead of the IP address. Each website will get it's own "VirtualHost" section in apache's configuration file: httpd.conf. This VirtualHost section contains (among other things) the domainname and the name of the directory where the website pages are stored. The VirtualHost section can also have a "ServerAlias" entry which can list one or more alliasses for the primary domainname. This will instruct apache to serve the exact same website for the alias domainname as for the main domainname.
 
Back
Top