Overview
This article explains how to redirect a domain (or subdomain) at DreamHost. When creating a redirect, any page you visit on your current site (the one being redirected) is forwarded to the page on the site you're redirecting to. For example, let's say you're redirecting example.com to dreamhost.com.
- When you visit example.com/contact.html
- the URL redirects to dreamhost.com/contact.html
Prerequisites
The panel Redirect service requires that your domain be either hosted or registered with DreamHost.
The examples in this article use the HTTPS protocol. For this to work, the domain you're redirecting to must already have an SSL certificate configured. If not, just use HTTP instead.
Remove custom DNS records
If your domain is currently set as 'DNS Only' and you wish to change it to a Redirect, first check to see if you have previously added any custom A or CNAME records to the domain. If so, these will need to be removed as they will conflict with the new configuration.
Creating a redirect
The following lists different ways to create a redirect for your domain.
Redirecting a new domain or subdomain
- 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.
- Scroll down to the Non-Hosted section and select the Redirect Domain option.
- In the Destination URL text box, enter the domain to redirect to.
- Click the Redirect Domain button to save.
Changing an existing domain or subdomain to redirect
- 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.
- Click the Settings tab.
- Scroll down to the Redirect Domain box and click the down arrow on the right.
- Enter the URL in the Destination URL: field where you'd like this domain to redirect.
- Click the Redirect Domain button to complete the setup.
Creating a redirect to a subdirectory
If you need to create a redirect to a subdirectory of another site, make sure to add a trailing forward slash to the redirected URL. If you do not, the URL will not redirect correctly.
For example, if your site is example.com and you want to redirect to a subdirectory of another site called dreamhostexample.com/blog, make sure the redirect you create adds the trailing forward slash like this:
- dreamhostexample.com/blog/
If you do not add the forward slash, any files accessed within that subdirectory will not load since the URL will be incorrect.
You cannot redirect to a subdirectory of the same website.
Redirecting with an SSL certificate
You can only redirect to another site that's already configured with an SSL certificate. For example:
- http://example.com to https://dreamhostexample.com
If an SSL certificate has not been added to the domain you are redirecting TO (https://dreamhostexample.com), you will see a Site Not Found error when viewing the redirect.
It's not possible to use the panel's Redirect service to redirect to HTTPS on the same domain. For example:
- http://example.com to https://example.com
This is also not necessary since after you have added an SSL certificate to your domain, DreamHost automatically redirects the URL from HTTP to HTTPS.
How long until the redirect is working?
Redirecting 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.
Disabling a redirect
To disable a Redirect, you must change the hosting configuration to any other option such as 'Fully Hosted' or 'DNS Only'. View the following articles for instructions:
FAQs
Does setting a domain to Redirect delete my website files?
- Setting a redirect does not delete your current website or any of its files. You can add hosting back to the domain in the future at any time, which then displays your original content.
What type of redirect is created?
- When setting this up through the DreamHost panel, a 301 redirect is created automatically.
Does redirecting work for the www and non-www versions of the site?
- Yes. If you set up a redirect on example.com, it also will work for www.example.com.
Does the redirect change MX records?
- No. The redirect only changes where the website is hosted. Your MX (mail) records will not be changed in any way.