.htaccess only allow access to index.php and a directory
snippet in htaccess

.htaccess only allow access to index.php and a directory

user9948

DirectoryIndex index.php
RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^ index.php [L]

RewriteRule !^(public/|index\.php) [NC,F]