8

I'm competent with setting up records for domains, things like CNAME, A Records, etc - but what about if I just want to redirect it?

Do I "have to" do this using a .htaccess file on a host?

Or better said, what's the "cheapest" and most effective way of doing this? Thanks

2 Answers 2

15

A "3xx redirect" is an HTTP request/response so you need to use a service that accepts an HTTP request.

So, either:

  • Some domain registrars might offer an additional service to HTTP redirect the domain (most don't).

  • Point the domain you want to redirect, to a web hosting account and configure the redirect there. Either in .htaccess (on Apache) or using pretty much any server-side scripting language.

    • This does not necessarily need to be a dedicated hosting account just for the domain you want to redirect. You might have an existing account that you can just "Addon" an additional domain. A "web hosting account" is just a virtual host that accepts requests to this domain.
  • Point the domain at the same service/host you want to redirect to (and configure the host so they accept requests to this domain) and configure the redirect at the target host. This depends on the features provided by the target host.


Do I "have to" do this using a .htaccess file on a host?

No.

what's the "cheapest" and most effective way of doing this?

It depends on exactly what you are doing. And the capability of the services you are using. If you simply want a website to be accessible from two domains (and redirect one to the other) then you should use a webhost that allows you to add additional "Addon" domains. For some hosts this is standard feature at no additional cost; for others it's not. (The very cheapest shared hosting accounts probably only permit a single domain.)

9

Some sort of hosting is required

For a domain to redirect to another domain, it needs to have some sort of web hosting. Only a web server for the domain can issue the redirect that you need.

You have several options

  1. The biggest domain registrars such as GoDaddy and NameCheap offer free redirect services for any domain you register through them. However those services often don't work very well. GoDaddy has long term known issues where redirects don't work consistently for all clients. I've also never seen a registrar offer redirects that support HTTPS.
  2. Point the domain name to your existing hosting account. Your host may or may not allow additional domains. They are usually called "add-on domains". You can usually configure additional domains to redirect. It may involve .htaccess or it may not, depending on your host. Depending on your host, you may or may not be able to get a HTTPS certificate for the redirecting domain.
  3. Use a third party service to do the redirects.

I usually recommend Cloudflare

The best third party service for redirecting domains that I have been able to find is Cloudflare.

  • It is free. They offer a free-tier of service for every domain you add. You can redirect the domain under the free service tier.
  • Their redirects are reliable.
  • They support HTTPS. They automatically generate an SSL certificate for your redirecting domain. They keep that certificate up to date without any intervention for you.
  • The down side is that it is a bit difficult to set up.

To use Cloudflare, follow the instructions I created for setting up domain redirects using their free-tier service.

4
  • 2
    "I've also never seen a registrar offer redirects that support HTTPS." It's starting to happen because Google's HSTS preloaded TLDs necessitate it. E.g. Google Domains and Porkbun support it. Commented Feb 13, 2021 at 22:44
  • I believe Network Solutions also supports simple redirects without hosting.
    – Trebor
    Commented Feb 15, 2021 at 15:26
  • 1
    @Trebor this article says that network solutions charges $12 per year for domain forwarding and doesn't support SSL. It could have changed recently, but Network Solutions tends to charge high prices and not reduce prices based on competition. In my experience they milk their reputation of being the first domain registrar. Commented Feb 15, 2021 at 17:08
  • @StephenOstermiller, yes they did charge me for the forwarding. But it was a short term solution while I migrated my hosting to another domain. I wasn't aware of the SSL issue, as at the time, I wasn't using SSL. Thanks for the homework.
    – Trebor
    Commented Feb 16, 2021 at 1:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.