For various reasons regarding this site's host, we are running a Drupal 7 site inside a subfolder "live" so the path to D7 is /home/username/public_html/live/
To get the Drupal 7 site to load from the subfolder, we have the .htaccess below in /home/username/public_html and it works great.
RewriteEngine on
RewriteRule ^$ live/index.php [L]
RewriteCond %{DOCUMENT_ROOT}/live%{REQUEST_URI} -f
RewriteRule .* live/$0 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* live/index.php?q=$0 [L,QSA]
However, if I type https://website.com/live/index.php, the home page of the site loads and the URL in the location bar does not mask to https://website.com. A previous problem with a different rewrite rule caused other visitors to have reached this page and this has caused https://website.com/live/index.php to be included in our Google Analytics statistics.
Is there a way to rewrite .htaccess rules to avoid https://website.com/live/index.php being visible from now on? The .htaccess at /home/username/public_html/live is the default D7 .htaccess.
Answer was to add another .htaccess file inside the /live folder:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s+\/live/index\.php\s+ [NC]
RewriteRule ^ https://%{HTTP_HOST} [L,R=301]
</IfModule>