Apache Redirect NON-SSL to SSL

If you want to force your site visitors to view your web site over an SSL connection and you have your SSL vhost already properly created in Apache, you can add the following to your .htaccess file in the root of your site:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

Wayne Egerer

Leave a Reply