Why/How I could remove index.php in the URL I have added a RewriteRule to force https on one domain at the end of my .htaccess file

RewriteCond %{HTTP_HOST} ^www.mydomain\.be [NC]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}


It is working fine except that after that, I get a /index.php/ inside all URL

If I add RewriteEngine on before like the following:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.mysite\.be [NC]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}


Then my /index.php/ problem is solved...

I am happy with that, but I don't understand why

Note: Those lines are added at the end of a regular drupal .htaccess. I mean no change in it except that I have uncommented the all to "www" rule (before my https rule at the end)

RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


There are no special apache2 conf as welll
I suggest you look at the .htaccess file supplied with Drupal, beside index.php. In the standard one, it has rules for both redirecting http: to https: (line ~104) and for rewriting URIs to index.php (line ~136)

Some servers are configured with these rules in the main config file because relying on .htaccess results in slower response from Apache (it reads the main files on startup but .htaccess per request).

So:
- Remove any additional rules you have added (i.e. revert to "out of the box") and check for expected behaviour;
- Uncomment the protossl conditions in .htaccess and check again;
- Optionally, move some of these into the .conf file for faster response.