Sign in
Log inSign up

How to Redirect Hashnode Subdomain to Custom Domain?

Alimam Miya
·Sep 24, 2021·

1 min read

How to redirect Hashnode subdomain alimammiya.hashnode.dev to errorbynight.com domain?

If the user visits this subdomain alimammiya.hashnode.dev, he will automatically reach this domain errorbynight.com.

  • Earlier the subdomain of my Hashnode blog was alimammiya.hashnode.dev and today I bought a custom domain which I added in the domain section of Hashnode.

  • Now I am opening my blog so it is opening on both subdomain and domain. So how can I solve this problem?

As I checked canonical is from the custom domain. But it can still affect the ranking of SEO and If the same content is on the domain and subdomain, then we can lose the trust of the visitors And those who are my old backlinks which are targeting the subdomain, they will be useless. Due to this, the ranking of our website may be down.

Recommendation

You can solve this problem by using .htaccess, You can create rules of redirection in it. So that if someone then adds a custom domain, then its subdomain gets redirected.