Advertisement
Niko454

Untitled

Apr 24th, 2015
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. RewriteCond %{HTTPS} off
  2. # First rewrite to HTTPS:
  3. # Don't put www. here. If it is already there it will be included, if not
  4. # the subsequent rule will catch it.
  5. RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  6. # Now, rewrite any request to the wrong domain to use www.
  7. RewriteCond %{HTTP_HOST} !^www\.
  8. RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement