I've just moved my site to https so I'm wanting to put a redirect into my htaccess so that anyone heading to http:// will be forced to https://.
However, I already have a snippet in my htaccess that's necessary for my site to work (the rewrite all other urls to index.php). When I remove this the redirect works, but my site won't direct to the other pages.
Here's my current htaccess-
Options -indexes
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Allow any files or directories that exist to be displayed directly
# Rewrite all other URLs to index.php/URL
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 index.php
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 week"
ExpiresByType image/png "access plus 1 week"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 week"
ExpiresByType text/css "access plus 1 week"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType application/pdf "access plus 1 year"
ExpiresByType audio/x-wav "access plus 1 year"
ExpiresByType audio/mpeg "access plus 1 year"
ExpiresByType video/mpeg "access plus 1 year"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/quicktime "access plus 1 month"
ExpiresByType video/x-ms-wmv "access plus 1 year"
ExpiresByType application/x-shockwave-flash "access 1 year"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
</IfModule>
<Files 403.shtml>
order allow,deny
allow from all
</Files>
Where and what do I need to include to force users to https instead of http without messing up the URLs?