Forum Moderators: phranque
Use RewriteMap in httpd.conf to call a PERL script, do a database lookup and return the new URL to mod_rewrite in httpd.conf or .htaccess.
See RewriteMap in the mod_rewrite documentation.
Alternately, simply pass the unchanged "booktitle" in the URL to your books.php script, and let the script extract it. In other words, instead of reading "id=3" in books.php, just get the REQUEST_URI and extract "booktitle" from it. You'd only need to use a rewrite rule to rewrite *all* /products/<anything> URLs to this script, and let the script deal with extracting and determining the meaning of the <anything> part of the URL. Also see Apache 2.x AcceptPathInfo.
Jim