Options -Indexes
DirectoryIndex public/index.php

RewriteEngine On

# -------------------------------------------------
# Do not rewrite anything already inside /public
# -------------------------------------------------
RewriteRule ^public(?:/|$) - [L]

# -------------------------------------------------
# Allow admin folder directly
# -------------------------------------------------
RewriteRule ^admin(?:/|$) - [L]

# -------------------------------------------------
# Allow existing files/folders
# -------------------------------------------------
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# -------------------------------------------------
# Send all other requests to public
# -------------------------------------------------
RewriteRule ^(.*)$ public/$1 [L,QSA]