VestaCP stop a second domain loading pages from the first one
I am using vestacp on my droplet running Ubuntu. I have two domain names that I’ve configured in Vestacp. Each domain is configured with the following nameservers at the registrar:
for domain1.com > ns1.domain1.com, ns2.domain1.com
for domain2.com > ns1.domain2.com, ns2.domain2.com
I have created two DNS entries in VestaCP, both pointing to the single ip address asigned to the droplet. Both entries have template : child-ns.
domain1.com also has SSL certicate configured.
domain2.com does not have SSL.
Let’s say I have a page on domain1.com called mypage.
The problem is, I can access that page through domain2 by adding https like so:
https://www.domain2.com/mypage (even though this page does not exist on domain2)
Google somehow noticed this and it’s now indexing pages from domain1.com, under domain2.com which I don’t want. What am I doing wrong? How can I stop this behaviour?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.