How to Redirect from One Domain to Another
Redirects are a simple tool, but tricky to manage. I like to think of them like the person of interest boards you see in crime shows that connect peoples’ headshots to one another with a red string.
The more connections you create, the more difficult it becomes to manage, and harder to remember it begins and ends.
The same can be said for redirects… which is why you should only use a redirect when it’s absolutely necessary. The last thing you want to do is create a redirect loop or increase your load times because of too many redirects.
How Redirects Work
Most modern websites use redirects. For example, if you go to our homepage, there are a handful of redirects being used to funnel traffic to the right version of our homepage.
- HTTP to HTTPS redirect
- www. to the “naked” version of dnsmadeeasy.com
- All possible subdomains to dnsmadeeasy.com (with the exception of a few we reserve for our help site and blog)
These redirects are considered “internal” and operate on the same FQDN (Fully Qualified Domain Name), dnsmadeeasy.com. You can create them using simple CNAME records that point one hostname to another or on your web server using 301 redirects.
But what if you want to redirect one domain to another?
HTTP Redirection Records
For any redirects that point outside of your FQDN, you need to use a special kind of DNS record called an HTTP Redirection record.
These records are actually an A record that points to a dedicated web server containing the 301 redirect to the external FQDN.
All you have to do is create two HTTP redirection records.
Psst! If you have any existing root records, you will need to delete them prior to creating your HTTP redirection records.
- Leave the name field blank (this is the root) and point it to the full URL of the destination domain.
- For the second record, name is * (wild card) and point it to the full URL of the destination domain.
You can learn how to create HTTP redirection records on our help site.
Want to read more? Check out this blog on HTTP redirects and why HTTPS redirects are so #$%-ing hard.
Originally published at DNS Made Easy Blog.