Htaccess Force SSL with Redirect (Non Standard SSL Port Compatible)

This is post is now quite old and the the information it contains may be out of date or innacurate.

If you find any errors or have any suggestions to update the information please let us know or create a pull request on GitHub

Check out this little snippet of htaccess code to force SSL usage. Works regardless of port.


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


Tags: sslhtaccess