Search code examples
iis-7.5

How to have IIS serve from two directories as root


So, i have a website with new content in my root directory. I also have a bunch of old content which in the interest of keeping things clean, that I would like to stuff in a separate directory (or at least a sub directory), ie root/oldresources/. What I would like to configure is for an incoming request, to first attempt to find the content in the root folder, and if it does not find it there, to look at the same relative path inside oldresources. So if someone went to http://mysite.org/images/shapes.png, it would first look for root/images/shapes.png, and serve that if it found it. If it can't find it, I would like to try and serve root/oldresources/images/shapes.png. If it can't find it there, 404 like usual.

I've been googling around for the appropriate way to set this, but can't find anything.


Solution

  • I believe you may be able to achieve this by creating a module that handles the RQ_MAP_PATH notification. I'd be more specific, but I've never actually attempted to do something like this.