# Route all partage requests to index.php
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php [L]
</IfModule>

# Security headers
<IfModule mod_headers.c>
    Header always set X-Frame-Options "SAMEORIGIN"

    Header always set X-Content-Type-Options "nosniff"

    Header always set X-XSS-Protection "1; mode=block"

    Header always set Referrer-Policy "strict-origin-when-cross-origin"

    Header always set Content-Security-Policy "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:;"
</IfModule>

# Prevent directory listing
Options -Indexes

# Protect dotfiles
<FilesMatch "^\.">
    Require all denied
</FilesMatch>
