virtual host of Site1 change url to site2, and site2 show me the content of site1.

Posted June 20, 2020 565 views
ApacheDNSUbuntu 18.04

I have 3 virtual host.

  • site1: 80
  • site1: 443
  • site2: 80 If I put or it redirects fine. If I don’t specify https, it shows me site1 without a certificate, but with the address of site2. => url: (certificate and content failure of site1). = url: (with certificate). => url: site1 (without certificate). = url: (without certificate). I checked the virtualhost files, but can’t find the problem, can it be something from DNS?

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.

Submit an Answer
1 answer


I would recommend, adding a Vhost for site2 for port 443. That way you would not get that problem.

  • My problem was solved, I think it was generating a new certificate with the www and without www, I also think that I checked the virtual hosts so that they had a certificate with https and http. :)
    Also if I remember correctly, I removed a certificate for the IP.