Options -MultiViews
DirectoryIndex disabled

RewriteEngine On

# Allow Let's Encrypt challenge
RewriteRule ^\.well-known/acme-challenge/ - [L]

# Force HTTPS
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

# Never let Apache serve index.php/index.html for this app
RewriteRule ^(index\.php|index\.html?)$ / [R=301,L]

# Proxy everything to the Node plant-dashboard app (PM2 on :3008).
# NOTE: Do NOT put ProxyTimeout here — on many cPanel hosts it causes
# "500 Internal Server Error" (directive not allowed in .htaccess).
# Set ProxyTimeout 120 in the Apache vhost / WHM include instead.
RewriteRule ^$ http://127.0.0.1:3032/ [P,QSA,L]
RewriteRule . http://127.0.0.1:3032%{REQUEST_URI} [P,QSA,L]

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php82” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php82 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
