We have a VPS hosting 2 websites. WebsiteA.com has SSL.
WebsiteB.com doesn't have SSL but google indexes WebsiteB.com with HTTPS URLS from WebsiteA.com
Example: https://www.websiteB.com/url-from-website-A which of course doesn't exist and gives error but google indexes it.
It's not just one URL that have been duplicated, it's every url from website A.
We suppose it has an impact on SEO (duplicate content somehow) because we lost ranking.
VPS misconfiguration ? We use Ubuntu / Apache.
<VirtualHost *:80>
ServerName websiteA.com
ServerAlias www.websiteA.com
Redirect permanent / https://www.websiteA.com/
</VirtualHost>
<VirtualHost *:443>
ServerName websiteA.com
Redirect permanent / https://www.websiteA.com/
</VirtualHost>
<VirtualHost *:443>
DocumentRoot /var/www/websiteA.com/public/
ServerName www.websiteA.com
php_flag display_errors On
php_value memory_limit 256M
php_value error_reporting 2047
php_value post_max_size 32M
php_value upload_max_filesize 32M
<Directory /var/www/websiteA.com/>
Require all granted
AllowOverride All
Options +FollowSymLinks
</Directory>
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/websiteA.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/websiteA.com/privkey.pem
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /var/www/websiteB.com
ServerName websiteB.com
ServerAlias www.websiteB.com
<Directory /var/www/websiteB.com/>
Require all granted
AllowOverride All
Options +FollowSymLinks
</Directory>
</VirtualHost>