Options -Indexes

DirectoryIndex index.php

<IfModule mod_rewrite.c>
RewriteEngine On

# Protect private application directories and dotfiles independently of host defaults.
RewriteRule ^(?:app|database|storage|tools|tests|docs)(?:/|$) - [F,L,NC]
RewriteRule (^|/)\. - [F,L]

# Leave real files and directories untouched.
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# Optional compatibility routes. The portal also works through physical directories.
RewriteRule ^ai/widget\.js$ ai/embed.php [QSA,L,NC]
RewriteRule ^ai/chat/([a-f0-9]{40})/?$ ai/widget/index.php?key=$1 [QSA,L,NC]
RewriteRule ^case/([A-Za-z0-9_-]+)/?$ case/index.php?query=$1 [QSA,L,NC]
RewriteRule ^track/([A-Za-z0-9_-]+)/?$ track/index.php?token=$1 [QSA,L,NC]
RewriteRule ^embed/([a-f0-9]{40})/?$ embed/index.php?key=$1 [QSA,L,NC]
RewriteRule ^form/([a-z0-9-]+)/([a-z0-9-]+)/?$ form/index.php?brand=$1&form=$2 [QSA,L,NC]
RewriteRule ^request/([a-f0-9]{40})/?$ embed/index.php?key=$1 [QSA,L,NC]
</IfModule>

ErrorDocument 404 /404.php

<IfModule mod_headers.c>
Header always set X-Content-Type-Options "nosniff"
Header always set Referrer-Policy "no-referrer"
</IfModule>

<IfModule mod_authz_core.c>
<FilesMatch "(?i)^(?:\..*|error_log(?:\..*)?|composer\.(?:json|lock)|.*\.(?:sql|sqlite|ini|log|bak|dist|sh))$">
    Require all denied
</FilesMatch>
</IfModule>

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