RewriteEngine On

# Sessão mais longa
php_value session.gc_maxlifetime 7776000
php_value session.cookie_lifetime 7776000

# Opcional: caminho próprio da sessão
php_value session.save_path "/home/acompanheadm/public_html/stagix/storage/sessions"

# Permitir webhook WhatsApp
RewriteCond %{REQUEST_URI} ^/stagix/webhook/whatsapp$
RewriteRule ^ public/index.php [QSA,L]

# Se arquivo ou pasta existir, não reescreve
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# Resto vai para public/index.php
RewriteRule ^ public/index.php [QSA,L]