Advertisement
Guest User

Untitled

a guest
Aug 4th, 2015
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 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]
  9.  
  10. <Directory /some/where>
  11. [...]
  12. </Directory>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement