Options +FollowSymLinks
RewriteEngine On
RewriteMap name2id txt:/path/to/map.txt
RewriteRule ^/mods/([^/]+)\.html$ /mod.php?id=${name2id:$1|0} [QSA,L]
First time to make a URL rewriting with rewriteMap. I have a code above but it returns a 404 page if i run http://example.com/mysite/mods/abc.html
in my browser. I've put the above code in my virtual host file in apache configuration, I read in some forums that rewriteMap only works if you have access in httpd.conf and virtual host. mod_rewrite is running on my windows machine because I was able to run some rule defined in my .htaccess file.
The map.txt contains
abc 123
def 456
ghi 789