Options +FollowSymLinks

RewriteEngine On
RewriteMap name2id txt:/path/to/map.txt

RewriteRule ^/mods/([^/]+)\.html$ /mod.php?id=${name2id:$1|0} [QSA,L]

Very first time to create a URL spinning with rewriteMap. I've got a code above however it returns a 404 page basically run http://example.com/mysite/mods/abc.html during my browser. I have place the above code during my virtual host file in apache configuration, I just read in certain forums that rewriteMap only works for those who have access in httpd.conf and virtual host. mod_rewrite is running on my small home windows machine because I could run some rule defined during my .htaccess file.

The map.txt consists of

abc 123
def 456
ghi 789

Should you request /mysite/mods/…, your rule should prefer to be:

RewriteRule ^/mysite/mods/([^/]+)\.html$ /mod.php?id=${name2id:$1|0} [QSA,L]

If you are using RewriteBase, try getting rid of the first slash within the rule:

RewriteRule ^mods/([^/]+)\.html$ /mod.php?id=${name2id:$1|0} [QSA,L]