# Chat API — front controller rules
Options -Indexes
DirectoryIndex index.php

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Pass the Authorization header through to PHP (some cPanel PHP-FPM setups drop it)
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Everything that is not a real file goes to index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^ index.php [L]
</IfModule>

<IfModule mod_authz_core.c>
    # Never serve dotfiles, editor backups or logs
    <FilesMatch "^\.">
        Require all denied
    </FilesMatch>
</IfModule>

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

# If PHP runs as an Apache module, allow bigger uploads (php-fpm: edit php.ini / MultiPHP INI editor)
<IfModule mod_php7.c>
    php_value upload_max_filesize 20M
    php_value post_max_size 21M
</IfModule>
<IfModule mod_php.c>
    php_value upload_max_filesize 20M
    php_value post_max_size 21M
</IfModule>
