.htaccess with friendly url and https

1

I have a working website that uses friendly URLs, its current code is:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]

Now I need to keep the URL friendly and whenever it is accessed by HTTP forward to HTTPS, that way the whole site will work on HTTPS.

I'm trying with the code below, but I get "500 Internal Server Error" when I run it, but the url is loading on HTTPS.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{HTTPS} !=on
RewriteRule ^(. index.php)$ https://%{HTTP_HOST}%{REQUEST_URI} [L] 

Has anyone ever gone through this? How to reconcile the 2 conditions?

    
asked by anonymous 27.06.2017 / 21:35

0 answers