# Clean URLs: /toronto/ → index.php?area=toronto, /sitemap.xml → sitemap.php
RewriteEngine On
RewriteOptions Inherit

RewriteRule ^sitemap\.xml$ sitemap.php [L]

# Add a trailing slash: /toronto → /toronto/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z0-9-]+)$ %{REQUEST_URI}/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z0-9-]+)/$ index.php?area=$1 [L,QSA]

# Keep config.php private (Apache 2.4+)
<IfModule mod_authz_core.c>
  <Files "config.php">
    Require all denied
  </Files>
</IfModule>
