I would like mod_rewrite in an .htaccess file to link to a mysql database to provide me with mapping information.
Specifically, I am using a single code base to host multiple sites so..if a user requests an image, for example: http://www.example.com/images/car.jpg
this is going to hit my server and many other sites will also be hitting that /images folder, so I need Apache to reply with: /home/example/pubic_html/images/7383/car.jpg
Notice the injection of "7383" which is an example site id for that user.
Basically, I want to map between example.com and 7383 using the mysql database and then get the correct file to the user.
Any ideas?