In my MVC application, I'm directing all of my requests to my index.php file using an .htaccess file. In addition, I'd like to enforce SSL. Using this post, I've added '#enforce https' code . However, when I add the code to my .htaccess file, my browser complains that it will be unable to complete the request. How can I have both rewrite rules in the same file?
RewriteEngine On
#redirect to index.php as appropriate
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
#enforce https
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]