I am looking to dynamically serve images to web pages with htaccess based on the filename in the url. Normally, I use a nested directory structure throughout my website to serve a dynamic url based on the pseudo directory names. In this case, I would just like to query the file name (sans extension) and serve it to a PHP script so that:
/images/foo.jpg
becomes
/images/index.php?image=foo
while also let existing jpg images in this directory be served. I am sure it is easy, as I have been able to accomplish some pretty cool things with htaccess, but just not this one yet. Thanks.
like this:
note: if you need the extension you use
$2