Im using the following .htaccess for my website. I redirect all urls to index.php if their isn't a file located at the url.
Options +FollowSymLinks
IndexIgnore */*
# Turn on the RewriteEngine
RewriteEngine On
# Rules
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
This way http://website.com/user/user_name/ goes to index.php and http://website.com/css/style.css gives the actual css file (if style.css exists).
This works great, only i want to force https:// on the urls and i can't manage to get it to work. Any help is greatly appreciated.
Edit:
Using Jeroen's answer I got it working with the following .htaccess
Options +FollowSymLinks
IndexIgnore */*
# Turn on the RewriteEngine
RewriteEngine On
# Rules
RewriteCond %{HTTP:CF-Visitor} '"scheme":"http"'
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php