htaccess – Force SSL Rewrite on URL

General Development htaccess Mods Apache

Snippet Overview

htaccess – Force SSL Rewrite on URL

Are you looking to apply and SSL to a domain and have run into issues? Here is a handy block of code you can add to your htaccess file to force the url to render each page with the HTTPS protocol.

#Forcing https:
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L]
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply