PDA

View Full Version : Redirect HTTP to HTTPS .htaccess rule



Fli
02-21-2017, 01:26 PM
Hello, i wanted to share the .htaccess rule that will redirect all your website pages from HTTP to HTTPS:


# Redirect HTTP to HTTPS
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

no need to edit/update domain name inside rule as there are only variables -> it is universal

offcourse before applying such a rule, you need to have SSL installed on your hosting account.

If you know other useful rules for https redirection, you can share them