Options -Indexes
RewriteEngine On

<FilesMatch "\.(py|yml|yaml|md|log|sh|env|conf|dockerfile)$">
    Order allow,deny
    Deny from all
</FilesMatch>

RewriteRule ^tools/ - [F,L]

RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]

RewriteRule ^$ /api/router.php?type=home [QSA,L]
RewriteRule ^about/?$ /api/router.php?type=about [QSA,L]
RewriteRule ^the-practice/?$ /api/router.php?type=practice [QSA,L]
RewriteRule ^services/?$ /api/router.php?type=services_index [QSA,L]
RewriteRule ^services/([a-z0-9-]+)/?$ /api/router.php?type=service&slug=$1 [QSA,L]
RewriteRule ^testimonials/?$ /api/router.php?type=testimonials [QSA,L]
RewriteRule ^gallery/?$ /api/router.php?type=gallery [QSA,L]
RewriteRule ^events/?$ /api/router.php?type=events [QSA,L]
RewriteRule ^events/([a-z0-9-]+)/?$ /api/router.php?type=event_detail&slug=$1 [QSA,L]
RewriteRule ^contact/?$ /api/router.php?type=contact [QSA,L]
RewriteRule ^privacy-policy/?$ /api/router.php?type=legal&slug=privacy-policy [QSA,L]
RewriteRule ^terms-of-service/?$ /api/router.php?type=legal&slug=terms-of-service [QSA,L]

ErrorDocument 404 /404.html
ErrorDocument 500 /500.html
