How to configure www & root domain in hashnode over SSL.

How to configure www & root domain in hashnode over SSL.

Configure redirection for your custom domains

·

3 min read

Before we start, let me ask you a question:

Are you using custom domain in hashnode to show your posts?

If your answer is Yes, then this post is for you.

Is your intention to show your posts on hashnode on a custom domain with www and a root domain(like www.thebiggtalks.com and thebiggtalks.com) over SSL (https).

How I ended up writing this post

A few days back, when i tried to configure my domain in hashnode, i noticed that, something is broken. Either one of the https://www.thebiggtalks.com or https://thebiggtalks.com will work. But if I call http://www.thebiggtalks.com or http://thebiggtalks.com, then both will be redirecting to right endpoint. So I started looking at other blogs in hashnode which use custom domains, then I realized that most of them are facing similar issue.

After reconfiguring multiple times, i was able to serve my blog over both www and root domain, where one will be redirecting to the right domain configured in hashnode.

So here I want to share my configuration which i used, so that everyone can benefit out of it.

I'm using Google Domains as a domain name registrar; later we can see how we can achieve it in Godaddy or any other similar platforms. And there is a difference in configurations w.r.t Google domains vs Godaddy or other platforms, so the below google domain configuration might not work for other platforms, if you are not using google domains, you can directly jump to Godaddy configuration which will be similar to other platforms like namecheap, cloudflare, synergywholesale etc.

Configuration in Google Domains

Here the hashnode configuration is thebiggtalks.com

Screenshot 2022-01-03 at 5.34.52 PM.png

  1. Configure the A record as show in screenshot. Screenshot 2022-01-02 at 10.25.37 AM.png

  2. Configure the Forwarding as shown below. Screenshot 2022-01-02 at 10.32.03 AM.png

Screenshot 2022-01-02 at 10.31.46 AM.png

You are done, wait for sometime and start accessing your endpoint and verify it is working.

Configuration in Godaddy

Here the hashnode configuration is www.thebiggtalks.com

Screenshot 2022-01-03 at 5.33.24 PM.png

  1. Configure the A record as show in screenshot. Screenshot 2022-01-02 at 10.37.48 AM.png

  2. Configure CNAME record. Screenshot 2022-01-03 at 5.30.03 PM.png

  3. Configure the Forwarding, here select domain or subdomain depending on your requirement to forward. I'm selecting Forward domain to achieve the same which i showed above.

Screenshot 2022-01-03 at 5.41.01 PM.png You are done, wait for sometime and start accessing your endpoint and verify it is working.

Configuration in Namecheap

Here the hashnode configuration is www.thebiggtalks.com

Screenshot 2022-01-03 at 5.33.24 PM.png

  1. Configure the A record and CNAME as show in screenshot. Screenshot 2022-01-11 at 11.12.05 PM.png

Similarly, you can configure the same if you are using a different domain name registrar other than Google domains/Namecheap/Godaddy. I have tried only with these 3 platforms.

Before we conclude, Key points to keep in mind

The below points can be followed for any DNS portals.

  1. Always add A record and CNAME record in DNS management portal.
  2. Add a redirection from root domain to subdomain (http) in the portal.
  3. Then create root domain/subdomain in hashnode. If that didn't work try creating and deleting multiple times in hashnode.
  4. Better to configure subdomain in hashnode. Because from my personal experience I have faced sometimes subdomains are not properly redirecting to root domains in some portals. So always configure subdomain in hashnode and do a redirection from root domain to subdomain.

A few other resources which may help you to configure custom domains:

  1. support.hashnode.com/docs/mapping-domain
  2. hashnode.com/post/how-to-set-up-a-custom-do..

Thanks for reading, please share it within your network, if this resonates with you.

You can also connect with me on twitter as I will be inscribing my thoughts there very frequently.