Https redirect for htaccess

November 15, 2012

Simplest way to redirect directly in htaccess

Sometimes you don’t have access to the server and have to do a redirect in a .htaccess file.

1
2
3
RewriteEngine on
RewriteCond %{HTTPS} !^on$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]