I have installed Web site on my Ubuntu Server.
The following things are installed on my Server for running web service. 1) Apache2 2) PHP5 3) MySql
My main website is redirected to https.
Example (changed for security purpose)
<VirtualHost *.80> ServerName www.example.com ServerAlias example.com Redirect permanent / https://www.example.com </VirtualHost>
In my default-ssl.conf file i have added the following info.
<VirtualHost _default_:443> ServerAdmin firstname.lastname@example.org ServerName example.com ServerAlias www.example.com DocumentRoot /var/www/example.com/public_html SSLEngine On SSLCertificateFile /etc/ssl/example.com/sslcertificate.pem SSLCertificateKeyFile /etc/ssl/example.com/sslcertificate.key </VirtualHost>
Other settings in above is default.
My main issues comes when i create link for my website like www.example.com it goes to Apache2 Default Web Page and does not go to correct site. If i write in browser directly it works perfect and redirects to https://www.example.com