Advertisement
lukmans

.htaccess HTTP To HTTPS

Apr 27th, 2018
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. RewriteEngine On
  2. RewriteCond %{HTTPS} off
  3. RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  4. RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  5. RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement