Files
maria_uslugi/public/uploads/.htaccess
T
2026-03-05 10:25:39 +01:00

31 lines
1.0 KiB
ApacheConf
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# --- Bloquer l’exécution & l’index de dossier ---
Options -Indexes
# (FPM : pas besoin de php_flag engine off)
# --- Bloquer toute URL qui contient ".php" même en double extension (ex: .php.jpg) ---
RewriteEngine On
RewriteCond %{REQUEST_URI} \.php [NC]
RewriteRule ^ - [F]
# --- Interdire l’accès aux extensions exécutables ---
<FilesMatch "\.(php|phtml|phps|phar|cgi|pl|py|sh|rb|jsp|asp|aspx)$">
Require all denied
</FilesMatch>
# --- Neutraliser tout handler scripts dans ce répertoire ---
RemoveHandler .php .phtml .phps .phar .cgi .pl .py .sh .rb .jsp .asp .aspx
RemoveType .php .phtml .phps .phar .cgi .pl .py .sh .rb .jsp .asp .aspx
# --- (Optionnel) Renforcer la politique locale pour les SVG ---
<IfModule mod_headers.c>
<FilesMatch "\.svg$">
Header set Content-Security-Policy "script-src 'none'; style-src 'unsafe-inline'"
Header set X-Content-Type-Options "nosniff"
</FilesMatch>
</IfModule>
# (Optionnel) Forcer le téléchargement pour types sensibles
# AddType application/octet-stream .svg .xml .json