# Use index.php as the default file
DirectoryIndex index.php index.html

# Enable URL rewriting
<IfModule mod_rewrite.c>
    RewriteEngine On

    # Set the base directory for rewrites
    RewriteBase /

    # Don’t rewrite requests for existing files or directories
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    # Redirect everything else to index.php
    RewriteRule ^(.*)$ index.php [L]
</IfModule>

# Custom error handling (optional)
ErrorDocument 404 /index.php
ErrorDocument 403 /index.php
