Free HTTPS Certificate from Let’s Encrypt

If you want to secure the connection of your server with a valid and free certificate – that also modern browser will recognise – you should go to this website and follow the instructions there. Currently big companies like Akamai, Cisco, Mozilla and Facebook are supporting Let’s Encrypt so I guess there is no argument not encrypting the communication to your server. Additional this tool configures your existing Apache server so that your HTTPS connection is set up in less than 5 minutes.

Here is the link:

After that you can test your website on security issues:

Hint: non www to www
Now if you have a certificate for your and you want to redirect to you have to add the following commands to your default-ssl.conf located in /etc/apache2/sites-available directory:

<VirtualHost *:443>
RewriteEngine on
#RewriteCond %{HTTP_HOST} !^localservername -->used for local access
RewriteCond %{HTTP_HOST} !^www\. -->check if www is missing
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}$1 [R=301,L] -->add www.

Your default.conf located in /etc/apache2/sites-available should be modified as shown below:

<VirtualHost *:80>
	# redirect all http queries to https
	Redirect permanent / 
<VirtualHost *:80>
  RewriteEngine On
  RewriteCond %{SERVER_PORT} ^80$
  RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]