# Disable directory browsing
Options -Indexes

# Enable rewrite engine
RewriteEngine On

# If the requested file does not exist
RewriteCond %{REQUEST_FILENAME} !-f

# If the requested directory does not exist
RewriteCond %{REQUEST_FILENAME} !-d

# Redirect all invalid requests to index.php
#RewriteRule ^ index.php [L]
RewriteRule ^ / [L]

# Custom 404 page (optional)
ErrorDocument 404 /404.html