# Désactiver l'affichage des dossiers
Options -Indexes

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Si fichier/dossier n'existe pas → afficher 404.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^ pages/404.php [L]

    # Si c'est un dossier sans index → afficher 404.php
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteCond %{REQUEST_FILENAME}/index.html !-f
    RewriteCond %{REQUEST_FILENAME}/index.php !-f
    RewriteRule ^ pages/404.php [L]
</IfModule>
