I have been looking for the best way to switch my website's root index.html file to a index.php file. My research indicates that doing this carelessly will result in a hit to my rankings in Google and that my best option is to parse the index file as php, noting that this is the only file on the site where such parsing is anticipated to be needed.
I read a great SO thread here: Parse HTML as PHP which was very useful on this subject and I am settled on using the Filesmatch directive to do this in my .htaccess file. However the best response presented there IMHO was one which suggested the following code.
<FilesMatch "^file_name\.html$">
AddType application/x-httpd-php .html
</FilesMatch>
I of course implemented this as:
<FilesMatch "^index\.html$">
AddType application/x-httpd-php .html
</FilesMatch>
While this works just fine for the root index.html page, all the site's sub-directories also have index.html pages and it turns out that they are all getting parsed as php too. For security, I don't want this behaviour. I am not an Apache pro and am getting out of my depth a little here hence asking you guys. Is there a way to stop this and make the root index file the only one targeted by this Filesmatch directive? Thank you.