# Use dashboard.php as the default landing page instead of index.php
DirectoryIndex dashboard.php

# Make sure index.php is ignored as a default file
<IfModule mod_rewrite.c>
RewriteEngine On

# If someone tries to access index.php directly, redirect to dashboard
RewriteCond %{THE_REQUEST} \s/+index\.php[\s?] [NC]
RewriteRule ^index\.php$ /dashboard.php [R=301,L]

# Allow direct access to existing files and directories
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# (Optional) If you want all unmatched URLs to redirect to dashboard.php
# Uncomment the next 2 lines:
# RewriteRule ^.*$ dashboard.php [L,QSA]

</IfModule>
