I purchased a certificate that is valid for both www.example.com and example.com. My server is working only with "www.example.com" (ssl is working fine) but it is not showing anything at all when I type "example.com" on the browser. Here is my apache file config which basicly is the same virtualHost twice but with different ServerName
Define APACHE_LOG_DIR /var/log/apache2 Define SSLCERTIFICATE /etc/apache2/ssl/mycertificate.crt Define SSLKEY /etc/apache2/ssl/mykey.key <IfModule mod_ssl.c> <VirtualHost *:443> ServerAdmin [email protected] ServerName www.example.com DocumentRoot /var/www/site2/ ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined SSLEngine on SSLCertificateFile ${SSLCERTIFICATE} SSLCertificateKeyFile ${SSLKEY} <FilesMatch "\.(cgi|shtml|phtml|php)$"> SSLOptions +StdEnvVars </FilesMatch> <Directory /usr/lib/cgi-bin> SSLOptions +StdEnvVars </Directory> <Directory /> Options FollowSymLinks AllowOverride All </Directory> <Directory "/var/www/site2"> Options Indexes FollowSymLinks MultiViews AllowOverride All Order Allow,Deny Allow from all </Directory> BrowserMatch "MSIE [2-6]" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 # MSIE 7 and newer should be able to use keepalive BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown </VirtualHost> # Same documetn root for example.com (without www) <VirtualHost *:443> ServerAdmin [email protected] ServerName example.com DocumentRoot /var/www/site2/ ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined SSLEngine on SSLCertificateFile ${SSLCERTIFICATE} SSLCertificateKeyFile ${SSLKEY} <FilesMatch "\.(cgi|shtml|phtml|php)$"> SSLOptions +StdEnvVars </FilesMatch> <Directory /usr/lib/cgi-bin> SSLOptions +StdEnvVars </Directory> <Directory /> Options FollowSymLinks AllowOverride All </Directory> <Directory "/var/www/site2"> Options Indexes FollowSymLinks MultiViews AllowOverride All Order Allow,Deny Allow from all </Directory> BrowserMatch "MSIE [2-6]" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0 # MSIE 7 and newer should be able to use keepalive BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown </VirtualHost> </IfModule> Aditional Information:
- my site is hosted in a virtual machine in Azure (Ubuntu 14.04 LTS)
- the domain name is from goDaddy
- there is another configuration file for http (port 80)