If you have SSL installed and configured on your site, there is a little need to continue serving http traffic over port 80. Performance is no longer a big issue and now Google would reward with better ranking sites that serve all content over https.

It is very easy to achieve that on an Apache server.

1. Make sure that you have enabled mod_rewrite
2. Add the following to your .conf file for the site:

<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteCond %{HTTPS} off
	RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

The above code goes in the VirtualHost defininition for port 80. Make sure that you also have a VirtualHost definition for port 443.

In order for this to take affect, don’t forget to:

sudo service apache2 reload
Force all HTTP traffic to HTTPS

Leave a Reply

Your email address will not be published. Required fields are marked *