<IfModule mod_rewrite.c>
    RewriteEngine On
    
    # Do not rewrite if the request is already pointing to the public directory
    RewriteCond %{REQUEST_URI} !^/[^/]+/public/ [NC]
    RewriteCond %{REQUEST_URI} !^/public/ [NC]
    
    # Forward everything to the public folder
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
