[eluser]Unknown[/eluser]
For some reason the .htaccess versions from Phil_b and terminate were not working for me but the following does.
I read on other forums that the remove index rule for codeigniter should go at the bottom, that is after the HTTP/HTTPS handling, and then in that case I had to remove the L definition for those two rules.
This was really giving me headaches, so am posting just in case anyone else experience the same issues as me. I am not sure about what was causing the difference though as the versions posted here should have worked in theory. The only difference I see is that I have codeigniter placed in a subfolder on my server.
Code:
RewriteEngine on
Options +FollowSymLinks
RewriteBase /subfolder/
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} (auth|register|secure|payment)
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,QSA]
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(static|auth|register|secure|payment)
RewriteRule ^(.*)$ http://%{SERVER_NAME}%{REQUEST_URI} [R=301,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1