Advertisement
raul3k

Force www - force https when available

Jul 1st, 2015
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. RewriteEngine on
  2.  
  3. RewriteCond %{HTTP_HOST} !^$
  4. RewriteCond %{HTTP_HOST} !^www\. [NC]
  5. RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
  6.  
  7.  
  8. RewriteCond %{HTTPS} !=on
  9. RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  10.  
  11. RewriteCond %{REQUEST_FILENAME} !-f
  12. RewriteCond %{REQUEST_FILENAME} !-d
  13. RewriteRule ^(.*)$ index.php/$1 [L]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement