I have recently moved my site from one VPS to another. Everything is done right and working fine except one problem of ssl.
My site uses ssl. (using rapidssl certificate)
I followed the instructions from here to move my certificates from one server to another.
http://www.sslshopper.com/apache-server-ssl-installation-instructions.html
The problem I am facing is very strange to me. In HTTPS mode, My site works fine with the like url http://stackoverflow.com, https://stackoverflow.com however it does not work with https://www.stackoverflow.com (notice www).
The problem is strange to me because it does work on old server.
Thanks in advance.
Pras
Here are my virtual hosts
<VirtualHost *:80>
ServerAdmin webmaster@@localhost
DocumentRoot /var/www/webroot/
ServerName stackoverflow.com
ServerAlias www.stackoverflow.com
<Directory //var/www/webroot/>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost ***.***.***.***:443>
ServerAdmin webmaster@localhost
ServerName stackoverflow.com
ServerAlias www.stackoverflow.com
DocumentRoot /var/www/webroot/
<Directory /var/www/webroot/>
Options -Indexes
AllowOverride All
Order allow,deny
allow from all
</Directory>
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/thirdparty.crt
SSLCertificateKeyFile /etc/apache2/ssl/thirdparty.key
SSLCACertificateFile /etc/apache2/ssl/thirdpartyssl.ca
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
</VirtualHost>
</IfModule>
I found the solution.
First of all the problamatic url pattern was not working on the old server too. This has been confirmed by certificate guys.
So, I decide to forward all the “https://www.stackoverflow.com” url requests to https://stackoverflow.com. To do this, I have added few .htaccess rules:
These rules are generic and can work with all websites.
Hope this will save the time of others.