The goal: have certain URLs under SSL and others not.
The problem: When hitting the site under HTTPS, it isn’t respecting my .htaccess file and the rewrite of the URL to remove /index.php/.
—
I have tried several of the methods listed on this page and, no matter what I do I can’t seem to get the server to run under HTTPS without index.php in the URL:
Doesn’t work: https://example.com/shop/ (returns a 404: The requested URL /shop was not found on this server.)
Works: https://example.com/index.php/shop/
Here’s what I currently have in my .htaccess:
# Setup
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{REQUEST_URI} (register|login|checkout)
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301]
RewriteCond %{REQUEST_URI} !(register|login|checkout)
RewriteCond %{SERVER_PORT} ^443$
RewriteRule ^(.*)$ http://%{SERVER_NAME}%{REQUEST_URI} [R=301]
# rewrite out index.php
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
I’m the first to admit I don’t know a whole lot about HTTPS configuration, but is it possible I’m missing something there?
