Overview
A mirror allows you to upload your content to your DreamHost server 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 a .com and a .net site that share the same content or access your site live before your domain is set up. View the following article for further information:
A mirror domain can only "mirror" an existing domain 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.
Mirrored domains do not work well or at all with the following:
- 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 settings. If this is the case, you may need to make further adjustments within the CMS.
- DreamPress — A mirror of a DreamPress site will not work in most cases due to DreamPress caching.
dreamhosters.com subdomains
If your domain's 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 article:
If you need to access your database while the DNS is not pointed to DreamHost, view the following article:
Setting up a subdomain can take several hours, so a faster alternative for the technically inclined is to modify your host file to point to your DreamHost DNS records. The following article explains how to do this:
Internal linking
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 mirror.example.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): https://www.example.com/about-us.html
- This takes the user away from mirror.example.com. With this type of linking, it makes more sense to redirect rather than mirror.
Using relative paths is also essential if you implement secure hosting on your site since you won’t have to change any absolute links/paths from HTTP to HTTPS.
A reason to use a redirect domain instead
In many situations, it is better to redirect a 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.example.com that mirrors the actual website named siteA.example.com, when you visit siteB.example.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.example.com, the address bar changes to siteA.example.com.
Almost all search engines blacklist your domain if they find the same content as 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.
Creating a Mirror domain
- Navigate to the Manage Websites page.
- Click the Add Website button.
- Select one of the options to create or add a domain, then click the Next: Hosting button.
- Under the Non-Hosted section, click the Mirror Domain option.
- Select the domain you'd like to mirror and then click the Mirror Domain button.
You must ensure that the DNS records for the domain mirroring the real website point to DreamHost. You can view the following article for further information:
- 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 example.com shows you the content of example.dreamhosters.com.
Changing an existing domain or subdomain to a Mirror
- Navigate to the Manage Websites page.
- Click the Manage button to open the Domain Settings page, which allows you to adjust various settings for your site.
- Select the Hosting tab.
- Scroll down to the Non-Hosting Options section.
- Click the Mirror Domain subsection.
- Select the domain you'd like to mirror and then click the Mirror Domain button.
Turning off a Mirror
To turn off a Mirror, you must change the hosting configuration to any other option, such as 'Fully Hosted' or 'DNS Only'.
Will the mirror domain work with https?
No. If the site is mirroring a domain with https enabled, the mirror site will throw an error when visited. For example:
Let's say you set up the site example.com to mirror https://dreamhostexample.com. When you visit example.com, the URL will change to https://example.com and attempt to mirror the content of https://dreamhostexample.com.
Since the SSL certificate is not installed on example.com, the browser throws an error letting the visitor know that the site is not secure.
For this reason, you should not mirror a site using an SSL certificate.
How long until the mirror is working?
Mirroring your site is the same as any other DNS change. This means the DNS must propagate first before you can see the changes online. In general, this shouldn't take any longer than 6 hours. You can keep track of when the new DNS records update in different locations using either of the following links:
- whatsmydns.net — A popular site that checks DNS records around the world.
- Viewing your DreamHost DNS records — Use DreamHost's DNS propagation checker in the panel.