I have an IIS 6 website with an ISAPI dll to run an application. The application and ISAPI filter works well. I also have a couple of virtual directories set up to handle things like images without the need for the performance hit of accessing the ISAPI filter. However it seems like the ISAPI filter is a higher priority and is handling all requests before the virtual directories. How can I change this so requests for virtual directories are handled first and everything else goes to the filter?
You can't. Microsoft specifically says in ISAPI Filter Overview :
ISAPI filters always run on an IIS server, filtering every request until they find one they need to process. The ability to examine and modify both incoming and outgoing streams of data makes ISAPI filters powerful and flexible.
To be selective, maybe you should rather use an ISAPI Extension, since in this case the URL itself specifies the DLL to which the request is directed. In this case the DLL needs to handle the entire request itself.