In settings/override/site.ini.append.php put the following under [SiteAccessSettings]
RemoveSiteAccessIfDefaultAccess=enabled
You can probably remove the index.php by tweaking the .htaccess file if you're on shared hosting and adding the following in addition to the line above