I originally had the following httpd.conf setup:
<VirualHost *:80>
ServerName MainDomain.com
ServerAlias Alternate1.com Alternate2.com etc...
DocumentRoot /var/www/MainSite
...
...
</VirtualHost>
<VirualHost *:443>
ServerName MainDomain.com
ServerAlias Alternate1.com Alternate2.com etc...
DocumentRoot /var/www/MainSite
SSLEngine on
...
...
...
</VirtualHost>
I also had ssl.conf as follows
...
...
<VirtualHost _default_:443>
DocumentRoot "/var/www/DefaultSite"
SSLEngine on
...
...
...
</VirtualHost>
In the above configuration, Visiting both http and https versions of MyDomain.com and any aliases, it worked as expected.
If I visited the server by https://IPADDRESS, MainSite was returned, while http://IPADDRESS retunred "The requested URL / was not found on this server."
I need both http://IPADDRESS & https://IPADDRESS to return DefaultSite instead.
so in ssl.conf VirtualHost I added:
ServerName IPADDRESS:443
and added a new section to httd.conf
<VirtualHost _default_:80>
ServerName IPADDRESS
DocumentRoot /var/www/DefaultSite/
</VirtualHost>
Now MainDomain.com and all aliases are working as before with the new added functionality of http://IPADDRESS & https://IPADDRESS both resolve to the DefaultSite
I have 2 questions regarding this jounrney.
Why was visiting https://IPADDRESS resolving to MainDomain.com with the original configuration?
Is my current solution the proper / generally accepted way to make this work as I need?