I'm not all that familiar with htaccess and in attempting to do this myself I'm getting a too many redirects error so I thought I would go to the experts. I'm just looking for the right place within my htaccess file to force SSL on the entire site, while still removing www, removing index.php, etc (the usual fare for an EE install). My htaccess file currently looks like this:
<IfModule mod_rewrite.c>
# Enable Rewrite Engine
# ------------------------------
RewriteEngine On
RewriteBase /
# Redirect www Requests
# ------------------------------
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
# Redirect index.php Requests
# ------------------------------
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteCond %{THE_REQUEST} !/MySystemFolder/.*
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,L]
# Force SSL
# ------------------------------
# I'm guessing this is the position for the https rewrite rule
# but when I tried it, it resulted in a too many redirects error.
# Standard ExpressionEngine Rewrite
# ------------------------------
RewriteCond $1 !\.(css|js|gif|jpe?g|png) [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>
#add Expires
# ------------------------------
FileETag MTime Size
<IfModule mod_expires.c>
<filesmatch "\.(jpg|png|css|js|jpeg|woff|ttf|svg|eot|gif)$">
ExpiresActive on
ExpiresDefault "access plus 1 year"
</filesmatch>
</IfModule>
I would greatly appreciate being pointed in the right direction.