16
votes

I have purchased My Domain name from one registrar & hosted in another hosting company. I have created a sub domain from my hosting domain manager lie http://subdomain.domain.com and it works fine. But when someone types in www.subdomain.domain.com the site is not working.

Do I need to make changes in my DNS Manager of hosting CPanel or DNS Manager of my Domain CPanel?

Also What all Records I need to add ( like A Record or CNAME) to redirect www.subdomain.domain.com to subdomain.domain.com.

I don't want to see www for my subdomain, but only wants to get redirected to subdomain.domain.com.

6

6 Answers

13
votes

It doesn't work because www.subdomain.domain.com doesn't exist. You have to add a CNAME record in your zone subdomain.domain.com the same way you've added the host subdomain to domain.com.

10
votes

You need to register that subdomin too.

Yes - www.subdomain.domain.com is a subdomin of subdomain.domain.com. There is nothing special about the www prefix, as far as the domain system or browsers are concerned.

0
votes

Create CNAME as sub.domain.

Point to @ where sub.domain is your subdomain name and maindomain name.

0
votes

This helped me out. I hope it helps anyone going through the same thing.

Yes, as you said CNAME record www for customer1.mysite.com will report an error. To make it working, you should be able to add CNAME record www.customer1 for mysite.com instead of www for customer1.mysite.com - xMudrii https://www.digitalocean.com/community/questions/how-to-configure-subdomains-to-use-www-and-non-www

0
votes

If you want to add "www" in the subdomain then create the same configuration subdomain and add "www" in that domain.

you required to add both domains name www.subdomain.domain.com and subdomain.domain.com enter image description here

-1
votes

Say you have a website www.example.com and you want to have a working link like www.service.example.com, then you need to enter the subdomain name www.service (and not service) while setting up the sub-domain.

Preferably set up both sub-domains i.e. www.service and service for users who type in www.service.example.com and service.example.com on their browsers.