When redirecting to HTTPS from www, index.php appears in URL I have a redirect setup for www, it successfully redirects to https:// but it includes /index.php?p= in the URL. I'm not convinced by htaccess file is configured correctly.

Here's my htaccess file:

RewriteEngine On

# Send would-be 404 requests to Craft
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
RewriteRule (.+) index.php?p=$1 [QSA,L]

RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]


Help much appreciated.
There are docs for removing index.php from your URLs here: https://craftcms.com/support/remove-index.php

There are also docs for enforcing SSL for all CP requests here: https://craftcms.com/support/force-ssl

Note that they mention the the SSL rewrite should happen before the index.php rewrite in your .htaccess file.