<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php
</IfModule>

# Prevent directory listing
Options -Indexes

# Block access to specific files/directories in root
<FilesMatch "^\.|^composer\.(json|lock)|package\.json|gulpfile\.js|spark|build\.sh|LICENSE|README\.md">
    <IfModule authz_core_module>
        Require all denied
    </IfModule>
    <IfModule !authz_core_module>
        Order allow,deny
        Deny from all
    </IfModule>
</FilesMatch>
