How can I specify a URL rewrite in my web.config whereby any request for an image is served from a different directory on disk?
The images are located in directory site-root\foo\bar\images
. Normally they're accessible by http://site-root/foo/bar/images/
I'd like the images to be accessible via a different URL like http://site-root/img/
For example:
site-root\foo\bar\images\test.png
to be accessed at
http://site-root/img/test.png
I won't really need a filter for file extensions (png, gif, jpg, etc), but just rather any file/resource being requested from img
to be read from the real directory.
How can I use ASP.NET web.config URL rewrites, or any other method, to achieve this?
I'm going for a web.config solution, as this will be deployed to Windows Azure Websites.