Ugh, seems like I'm having a lot of htaccess issues lately. Recently moved a client site to new hosting from the cient's internal server. Their IT had setup SSL and updated the .htaccess to redirect http://site.com/login to https://site.com/login. This .htaccess file causes a "too many redirects" error. I've done a lot of trial and error testing on this and the results are always the same. I even found Adding a .htaccess redirect to https that plays nicely with existing EE .htaccess rules and tried that exact working htaccess file and got the same results. Any ideas?
RewriteEngine On
# Remove trailing slashes
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ /$1 [R=301,L]
# Redirect certain site pages to SSL and vice-versa
RewriteCond %{REQUEST_URI} !(login|themes|images|assets)
RewriteCond %{QUERY_STRING} !^(ACT=.*)$ [NC]
RewriteCond %{HTTPS} on
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,NC,L]
RewriteCond %{REQUEST_URI} (login)
RewriteCond %{HTTPS} !=on
#RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,NC,L]
# Remove index.php from URLs
RewriteCond $1 !(^index\.php|(\.(gif|jpe?g|png|css|js)))$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
I've commented out everything but this and still have the same issue...
RewriteCond %{REQUEST_URI} (login)
RewriteCond %{HTTPS} !=on
#RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,NC,L]