RewriteEngine On ## Begin - Index # If the requested path and file is not /index.php and the request # has not already been internally rewritten to the index.php script RewriteCond %{REQUEST_URI} !^/index\.php # and the requested path and file doesn't directly match a physical file RewriteCond %{REQUEST_FILENAME} !-f # and the requested path and file doesn't directly match a physical folder RewriteCond %{REQUEST_FILENAME} !-d # internally rewrite the request to the index.php script RewriteRule .* index.php [L] ## End - Index ## Begin - Security # Block all direct access for these folders RewriteRule ^(\.git|cache|bin|logs|backup|webserver-configs|tests)/(.*) error [F] # Block all direct access to files and folders beginning with a dot RewriteRule (^|/)\.(?!well-known) - [F] # Block access to specific files in the root folder RewriteRule ^(LICENSE\.txt|composer\.lock|composer\.json|\.htaccess|README\.md|data\.json)$ error [F] ## End - Security # Begin - Prevent Browsing and Set Default Resources Options -Indexes DirectoryIndex index.php