# Preserve Flutter's Bearer token when Apache forwards requests to PHP/PHP-FPM.
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP:Authorization} ^(.+)$
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%1]
</IfModule>

<IfModule mod_setenvif.c>
    SetEnvIfNoCase Authorization "(.+)" HTTP_AUTHORIZATION=$1
</IfModule>

# Database schemas, backups, configuration files and archives are not web assets.
<FilesMatch "(?i)(^error_log$|\.(sql|log|env|ini|bak|old|zip|sqlite|db)$)">
    Require all denied
</FilesMatch>

# Public Rockview University News URLs
<IfModule mod_rewrite.c>
    RewriteRule ^news/?$ api/public_news.php [L,QSA]
    RewriteRule ^news/([a-z0-9-]+)/?$ api/public_news.php?slug=$1 [L,QSA,NC]
</IfModule>
