I've got two websites being served from a ubuntu instance.
So, https://siteone.com and https://sitetwo.com both work fine.
My subdomain were fine https://subdomain.siteone.com and https://subdomain.sitetwo.com before I moved https://sitetwo.com to cloudfare.
SInce I did that The issue is https://subdomain.sitetwo.com displays https://siteone.com.
I have one public IP address available.
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName sitetwo.ca
ServerAlias www.sitetwo.ca
DocumentRoot /var/www/boom/
<Directory /var/www/boom/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/sitetwo.ca_error.log
CustomLog ${APACHE_LOG_DIR}/sitetwo.ca_access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.sitetwo.ca [OR]
RewriteCond %{SERVER_NAME} =sitetwo.ca
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName label.sitetwo.ca
DocumentRoot /var/www/html/laravel-db-import/public/
<Directory /var/www/html/laravel-db-import/public/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/label.sitetwo.ca_error.log
CustomLog ${APACHE_LOG_DIR}/label.sitetwo.ca_access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =sitetwo.ca [OR]
RewriteCond %{SERVER_NAME} =label.sitetwo.ca [OR]
RewriteCond %{SERVER_NAME} =www.sitetwo.ca
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>