<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^/.well-known/acme-challenge/(.*) /.well-known/acme-challenge/$1 [L]
# ✅ Proxy _next/image to Node.js (MUST be before static rule)
RewriteRule ^_next/image http://127.0.0.1:8004/_next/image [P,QSA,L]
# ✅ Serve _next/static files directly from disk
RewriteRule ^_next/static/(.*) .next/static/$1 [L]
# Allow access to static files with specific extensions
RewriteCond %{REQUEST_URI} \.(js|css|svg|jpg|jpeg|png|gif|ico|woff2|webp)$
RewriteRule ^ - [L]
RewriteRule ^index.html http://127.0.0.1:8004/$1 [P]
RewriteRule ^index.php http://127.0.0.1:8004/$1 [P]
RewriteRule ^/?(.*)$ http://127.0.0.1:8004/$1 [P]
</IfModule>