# Disable directory listing
Options -Indexes

<IfModule mod_rewrite.c>
    RewriteEngine On
    
    # Redirect root and all requests to the public directory
    # Check if request doesn't already point to public directory
    RewriteCond %{REQUEST_URI} !^/public/
    RewriteCond %{REQUEST_URI} !^/payments/public/
    
    # Rewrite to public directory
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

