<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} -d [OR]
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^ ^$1 [N]

    RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
    RewriteRule ^(.*)$ public/$1 

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php
</IfModule>

# block access
RedirectMatch 403 .env
RedirectMatch 403 .gitattributes
RedirectMatch 403 .gitignore
RedirectMatch 403 .htaccess
RedirectMatch 403 .bash.exe.stackdump
RedirectMatch 403 .builds
RedirectMatch 403 .composer.json
RedirectMatch 403 .composer.lock
RedirectMatch 403 .LICENSE
RedirectMatch 403 .phpunit.xml.dist
RedirectMatch 403 .preload.php
RedirectMatch 403 .README.md
RedirectMatch 403 .spark