.htaccess 709 B

123456789101112131415161718192021222324
  1. # Audit Express Self - Sécurité Apache (OVH)
  2. # Forcer HTTPS
  3. <IfModule mod_rewrite.c>
  4. RewriteEngine On
  5. RewriteCond %{HTTPS} off
  6. RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  7. </IfModule>
  8. # Désactiver l'affichage du contenu des répertoires
  9. Options -Indexes
  10. # Bloquer l'accès aux fichiers sensibles
  11. <FilesMatch "\.(env|log|json|sql|md|lock|yml|yaml)$">
  12. Require all denied
  13. </FilesMatch>
  14. # Protection contre le hotlinking des images (optionnel)
  15. # <IfModule mod_rewrite.c>
  16. # RewriteEngine On
  17. # RewriteCond %{HTTP_REFERER} !^$
  18. # RewriteCond %{HTTP_REFERER} !^https?://(www\.)?votredomaine\.fr [NC]
  19. # RewriteRule \.(jpg|jpeg|png|gif|svg|webp)$ - [F]
  20. # </IfModule>