Force Encrypted SSL Connection HTTPS Using The .htaccess File

Forcing visitors to use the secure encrypted SSL connection to your site is a good idea and can be accomplished through your .htaccess file using mod_rewrite.

All you need to do is add the following rule to the top of your .htaccess file:

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$$1 [R,L]

Remember to replace with your actual domain name.

This can be done on a WordPress or non-WP site where you can modify the .htaccess file.