Subdomain redirecting instead of CNAME

BobSmith123

Member
Apr 5, 2015
10
1
3
USA
cPanel Access Level
Website Owner
In CloudFlare, I've setup a sub.domainA.com to CNAME to domainB.com. I've set sub.domainA.com as a parked domain for domainB.com inside WHM. However, going to sub.domainA.com does a 301 redirect to domainB.com instead of behaving like an alias / CNAME. What is going on?

I'm on CloudLinux.
 

24x7server

Well-Known Member
Apr 17, 2013
1,912
99
78
India
cPanel Access Level
Root Administrator
Twitter
Hi,


You have a CNAME for sub.domainA.com that points to domainB.com, so if the domainB.com is configured to display its name in the URL, no matter whether you have parked domain on it or subdomain that goes to this domain, it will display what is in the URL of the website that is configured on the main site...
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Hello,

You should point the subdomain to the IP address of the cPanel server as an "A" record if you'd configured the domain name as an alias on the cPanel server.

Thank you.