Advertisement
Guest User

HTTPS redirect

a guest
Apr 15th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <IfModule mod_rewrite.c>
  2.     RewriteEngine on
  3.    
  4.     # Force to https
  5.     RewriteCond %{HTTPS} off
  6.     RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  7.    
  8.     # Redirect from no www to www
  9.     RewriteCond %{HTTP_HOST} !^www\. [NC]
  10.     RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [L,R=301]
  11. </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement