RewriteEngine On
RewriteBase /elliotts-cards/

# Serve static files and templates directly (no PHP)
RewriteCond %{REQUEST_URI} /static/ [OR]
RewriteCond %{REQUEST_URI} /templates/
RewriteRule ^ - [L]

# Serve uploaded images from data/uploads/
RewriteRule ^uploads/(.+)$ data/uploads/$1 [L]

# Don't rewrite existing files or directories
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# Everything else goes through the PHP-to-Python bridge
RewriteRule ^(.*)$ index.php [L,QSA]
