# ───────────────────────────────────────────────────────────────────────────── # .htaccess for Headless W CRM — w.bostonwebgroup.com # # INSTRUCTIONS: # 1. In cPanel File Manager, navigate to the document root of w.bostonwebgroup.com # (usually /home/CPANEL_USER/public_html OR a subdomain folder) # 2. Create a new file named exactly: .htaccess # 3. Paste everything below this line into that file and save # ───────────────────────────────────────────────────────────────────────────── Options -MultiViews RewriteEngine On # ── Proxy /api/* to the Node.js API server on port 3099 ────────────────────── # (Requires mod_proxy — enabled on most cPanel servers) RewriteCond %{REQUEST_URI} ^/api [NC] RewriteRule ^(.*)$ http://127.0.0.1:3099/$1 [P,L] # ── React SPA fallback — send all other routes to index.html ───────────────── RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^ /index.html [L]