Redirecting HTTP to Non-HTTP using a .htaccess file


The below can be added to a .htaccess file in order to redirect a website from HTTP, to HTTPS. It should generally be added before other rules.

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
Have more questions? Submit a request


Powered by Zendesk