RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
RewriteCond %{QUERY_STRING} ^id=([0-9]+)$
RewriteRule ^map.php$ /map%1?
RewriteCond %{REQUEST_URI} ^/map\d+$
RewriteRule ^map(\d+)$ /map.php?id=$1