I want to add www alias to my subdomains such that www.subdomain.domain.com, points to the same content as subdomain.domain.com

In my DNS record I currently have the following A --mysiteip-- sudomain1 IN CNAME domain.com. subdomaine2 IN CNAME domain.com.

www IN A --mysiteip--

In my Apache config I create virtualhosts for each subdomains, wehre I have the following in each hosts : ServerName subdomain1.mysite.com ServerAlias www.subdomain1.mysite.com

When I access subdomain1.mysite.com, I get served the proper content.

I tried adding www.subdomain1 IN CNAME domain.com. in my DNS record, which does not seem to be working. Can anyone point me in the correct direction?

有帮助吗?

解决方案

My solution was indeed correct. I just needed for the DNS to propagate, which took longer than usual.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top