Subdomain redirecting to another domain on my server

David DiGiovanni

Registered
Jan 31, 2017
2
0
1
USA
cPanel Access Level
Root Administrator
I'm trying to create a subdomain that maps back to my root domain to serve static files. I want static.domainA.com to point to domainA.com.

In cPanel, I setup static.domainA.com and pointed it to the /public_html folder. Then I changed the Alias of static.domainA.com to www[dot]domainA.com.

When I visit static.domainA.com, it redirects to store.domainB.com (domainB.com is another account I have setup on my server). So basically static.domainA.com is working perfectly, except it is aliasing the wrong domain (store.domainB.com instead of domainA.com).

Any ideas on what is going on here? Thank you!

Server Details:

/etc/redhat-release:CentOS release 6.8 (Final)
/usr/local/cpanel/version:11.60.0.35
/var/cpanel/envtype:kvm
CPANEL=release
Server version: Apache/2.4.16 (Unix)
Server built: Dec 9 2015 19:19:34
Cpanel::Easy::Apache v3.32.6 rev9999
PHP 5.6.16 (cli) (built: Dec 9 2015 19:29:45)
 

David DiGiovanni

Registered
Jan 31, 2017
2
0
1
USA
cPanel Access Level
Root Administrator
Hello,

Could you verify how you changed the alias for this subdomain?

Thank you.
Thanks for the reply Michael.

After I created the subdomain through cPanel, I went to the Advanced DNS page and saw an A Record listing for static.domainA.com with the alias being my server's IP address. I changed this to a CNAME Record and changed the alias to www.domainA.com.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,216
463
After I created the subdomain through cPanel, I went to the Advanced DNS page and saw an A Record listing for static.domainA.com with the alias being my server's IP address. I changed this to a CNAME Record and changed the alias to www.domainA.com.
You actually don't need to make the change in the DNS zone after creating the subdomain. As long as you have configured the document root to the correct location, both the subdomain and it's www prefix should load the contents from the primary domain name's document root.

Thank you.