# ─────────────────────────────────────────────
# Security: disable directory listing
# ─────────────────────────────────────────────
Options -Indexes

# ─────────────────────────────────────────────
# Rewrite engine
# ─────────────────────────────────────────────
RewriteEngine On

# Pass through requests for wt_webhook/* untouched
# so the webhook endpoint continues to work normally
RewriteRule ^wt_webhook(/.*)?$ - [L]

# Block direct access to views directory
RewriteRule ^views/ - [F,L]

# Route dashboard.php through the controller
RewriteRule ^dashboard\.php$ index.php [L]

# Pass through index.php itself
RewriteRule ^index\.php$ - [L]

# Route everything else to the controller (index.php)
RewriteRule ^ index.php [L]
