I have the following htaccess setup:
<IfModule mod_rewrite.c>
RewriteEngine On
# force https for all URLs in /admin.php
RewriteCond %{HTTPS} =off
RewriteRule ^admin.php https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# Redirect index.php Requests
# ------------------------------
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteCond %{THE_REQUEST} !/system/.*
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,L]
# 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>
This all works great, when a user goes to /admin.php they are forced to use https and when everywhere else they just use http. However if you navigate to a front end page using the https protocol you'll get a 404 error.
Seems to be because the index.php removal technique isn't working for https, for example:
https://domain.com/page - doesn't work https://domain.com/index.php/page - does work
http://domain.com/page - does work http://domain.com/index.php/page - does work
I can't work out what I need to change to make it work when in https as, as far as I can tell there isn't https/http specified in my htaccess for the index.php removal? Any ideas would be most appreciated!