Mirror Domain

From DreamHost
Jump to: navigation, search

Overview

A mirror allows you to upload your content to our servers for one site (site A), but use another site’s URL (site B) on the same account to view the original site (site A).

More technically, a mirror domain is a server alias on the DreamHost server that allows you to access the same DreamHost site content under more than one address. For example, you can have both a .com and a .net site that share the same site content, or access your site live before your domain is set up. View the following wiki for further information:

A mirror domain can only "mirror" an existing account at DreamHost, as it is merely a server alias. A mirror domain is a "mirror" only in terms of address aliasing; it is not a physical mirror and there is no content duplication involved, nor is it a "cloaking" or "domain gripping" facility.

Note2 icon.png Note: Mirrored domains and cloaked sites do not tend to work well with some CMS applications (WordPress for example). This is because some CMS applications hard-code the URL for the site and actively rewrite the URL in the browser address bar. This causes the URL for the site to change, effectively ruining the mirrored or cloaked settings. You may need to make further adjustments within the CMS if this is the case.


Creating a Mirror Domain

You can set up a Mirror Domain through your panel using the following instructions:

  1. Open the (Panel > 'Domains' > 'Manage Domains') page.
    01 Adding Domain Subdomain.fw.png
  2. Click the Add Hosting to a Domain / Sub-Domain button to create a new mirror domain.
    The Mirrored section appears in the lower part of the Manage Domains page:
    03 DNS viewing site.fw.png
  3. Enter the domains in the following fields:
    • Create the mirror at: This is the URL that mirrors the real website. For example, if you have uploaded your content to a DreamHost domain called yoursite.dreamhosters.com and want visitors to be able to access this at yoursite.com, enter "yoursite.com" .
    • Mirror this site: From the drop-down list, select the domain to which you’ve uploaded your content. This is the domain that will be mirrored.
  4. Click Mirror this domain to save your settings.

You must ensure that the DNS records for the domain that is mirroring the real website points to DreamHost. You can view the following wiki for further information:

Note2 icon.png Notes:
  • The DNS may take up to a few hours to update after you save the mirror.
  • Once the mirror domain is operational, visitors to the mirror domain will see the same content as the real site in which it is an alias.
  • In the above example, visiting yoursite.com shows you the content of yoursite.dreamhosters.com.


Dreamhosters.com subdomains

If your domain DNS records are not pointed to DreamHost and you wish to set up the domain before changing the DNS to minimize downtime, you can use a DreamHosters.com subdomain. You can read about how to set that up in the following wiki:

If you need to access your database while the DNS is not pointed to DreamHost, view the following wiki:

Setting up a subdomain can take several hours, so a faster alternative for the technically inclined is to modify your hosts file to point to your DreamHost DNS records. The following wiki explains how to do this:

Internal Linking

In order to have links on a site stay within the original URL address, they must not contain the domain name. This is called using a relative link or path. For example, if example-mirror.com is the mirror for the actual site named example.com, any links on the example.com site that contain "example.com" will take visitors to example.com. This defeats the purpose of a mirror.

For example:

Good (Relative): /about-us.html
This works and keeps the user at the current URL.
Bad (Absolute): http://www.example.com/about-us.html
This takes the user away from example-mirror.com. With this type of linking, it makes more sense to redirect, rather than mirror.
Note2 icon.png Note: Using relative paths is also essential if you decide to implement secure hosting on your site, since you won’t have to change any absolute links/paths from http to https.


Mirroring a subdomain if the root domain is not hosted with DreamHost

Example:

forum.siteone.com (not hosted at Dreamhost)

should take you to

dhforum.sitetwo.com (hosted at Dreamhost)

If you are trying to add an alias to a domain that is not hosted at DreamHost, you must add the root domain before you are able to set up the subdomain.

Below are instructions for mirroring a subdomain:

  1. Open the (Panel > 'Domains' > 'Manage Domains') page.
  2. Click the Add Hosting to a Domain / Sub-Domain link.
  3. When the next page opens, scroll down to DNS Only.
  4. Enter the domain siteone.com that is not hosted here at DreamHost, and then click Host DNS Only.
    The Manage Domains page opens after adding the domain.
  5. Add the subdomain by clicking the Add Hosting to a Domain / Sub-Domain link.
  6. When the next page opens, scroll down to the Mirrored section.
  7. To the right of Create the mirror at, enter: forum.siteone.com
  8. In the dropdown list, select dhforum.sitetwo.com (this must already be created).
  9. Click the Mirror this domain button to save your settings.
Note2 icon.png Note: You must make sure that you point the DNS for the subdomain mirror you created above to the IP address of the domain hosted at DreamHost. View the following DNS wiki for further information:


A reason to use a redirect domain instead

In many situations, it is better to use a Redirect Domain if you want the same content accessible from different domains. This is where visitors to any alternative domains are automatically redirected to your primary domain, instead of seeing identical content at the alternative URL.

The main difference is the URL you see: if you create a mirror at siteB.com that mirrors the actual website named siteA.com, when you visit siteB.com the address bar does not change. But, you still see the content of siteA.com.

If you create a redirect, when you visit siteB.com the address bar changes to siteA.com.

Almost all search engines blacklist your domain if they find the exact same content at another domain, which drops your site very far down in their search results. If you want the same content accessible from different URLs, it is best to use a Redirect Domain.

See also