<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteRule (^|/)\. - [F]

    RewriteCond %{REQUEST_URI} !^/public/
    RewriteCond %{DOCUMENT_ROOT}/public%{REQUEST_URI} -f [OR]
    RewriteCond %{DOCUMENT_ROOT}/public%{REQUEST_URI} -d
    RewriteRule ^(.*)$ public/$1 [L]

    RewriteCond %{REQUEST_URI} !^/public/
    RewriteRule ^(.*)$ public/index.php [L]
</IfModule>
