<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # ---------------------------------------------------------------
    # Evita el 403 cuando existe una carpeta fisica con el mismo nombre
    # que una ruta de la app (p.ej. public/properties o public/clients).
    # Estas rutas SIEMPRE las maneja Laravel, no Apache.
    # (Los archivos subidos ahora viven en public/uploads/, no chocan.)
    # ---------------------------------------------------------------
    RewriteRule ^(properties|clients)($|/) index.php [L]

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>
