<IfModule mod_rewrite.c>
    RewriteEngine On

    # Redirect any URL that still includes /public back to the clean path
    RewriteRule ^(.+?)/public/?(.*)$ /$1/$2 [R=301,L]

    # Serve the app from the public folder
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>