deny from all
<Files ~ "^[(index.php)]+$">
order allow,deny
allow from all
</Files>
The above snippet does what I want (i.e. limit access to any file other than index.php, but I also need to allow the default web address, which is the domain name without a file specified (which defaults to index.php anyway). With above code it is denied, but if I change it to this:
deny from all
<Files ~ "^[(index.php)]?$">
order allow,deny
allow from all
</Files>
it allows anything at all. How can I re-write my .htaccess snippet to allow only index.php or a blank filename, please?