This was asked long ago, but it's still out there, so here's an answer:
Your rule has the .asp in it, so it's looking for that in the url. Since you want just the product name, try this, without the .asp in the rule.
This is for isapi_rewrite v3:
RewriteMap mapfile txt:mapfile.txt [NC]
RewriteRule /([^/]+) /Products.asp?Prod=${mapfile:$1} [NC,QSA,L]
Use [NC] on the mapfile to let you have law 2
without worrying about case. (This is in build 3.1.0.62 and newer, which was a long time ago.)
v3 handles parameters outside of the rule, so the rule doesn't need to look for the ?
.
The QSA will append your Prod parameter to any incoming parameters. Since your rule was stopping at ?
, I assume you want to also handle incoming parameters. So parameters will survive.
This kept your rule of stopping at a slash (after the first slash), so everything from a slash onward will be ignored for matching, and dropped from the result.
So this will rewrite urls this way:
/LAW to /Products.asp?Prod=2
/lAw to /Products.asp?Prod=2
/LAW?abc=123 to /Products.asp?Prod=2&abc=123
/LAW/ to /Products.asp?Prod=2
/LAW/?abc=123 to /Products.asp?Prod=2&abc=123 (slash is dropped, but parameters survive)
/LAW/morestuff to /Products.asp?Prod=2 (/morestuff is dropped)
/LAW/morestuff?abc=123 to /Products.asp?Prod=2&abc=123 (/morestuff is dropped, but the parameters survive)
Original parameters are appended to the end of the rule substitution parameter(s), determined from documentation and verified from log files.