steveosoule
1/9/2013 - 10:29 PM

Common .htaccess Settings

Common .htaccess Settings

### SOURCE: http://stackoverflow.com/questions/6847649/htaccess-help-need-to-force-www-https-and-remove-index-php

### Force WWW: 

RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L] # include 's' here to force ssl in addition to www

### Force SSL:

RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L]
Remove "index.php":

### Remove "index.php"
RewriteCond %{THE_REQUEST} /index.php HTTP
RewriteRule (.*)index.php$ /$1 [R=301,L]