ISAPI Filters - Rewriting the URL (or commonly called URL Mapping)
Wade Hilmo called it courageous, I called it useful ...
Last week I delivered a presentation on CGI vs ISAPI and I “learned while on the job” ...In front of a webcast audience of about 50 people, I was showing what the capabilities of ISAPI filters are. I said that a ISAPI filter could take the following HTTP Get request:
www.mysite.com/foo/default.asp ...and re-write it to:
www.foosite.com ...and I was wrong. I didn't know. Wade jumped up from his chair with his head shaking and I was certainly not sure what I had done -- he told me. In short, filters can ReMap anything BUT the hostname. So, I corrected AND learned (after 4 years of supporting this product) that Filters can do this:
www.mysite.com/foo/default.asp is re-wrote to www.mysite.com/avoidfoo/default.asp -- This is DOABLE via an ISAPI filter.
I started at Microsoft as a support engineer and I quickly learned that ISAPI filters are difficult for many to write correctly and often sources of troubleshooting messes (I have been known to use stronger adjectives in the past.)
After 4 months of taking phone calls, I spent several hours on the phone troubleshooting why a customer could not enter more than 253 characters in the URI (http://foo/default.asp?id=aaaaaaaaaaaaaaaaa) up to 253. The production server worked, but he told me that his development server was identical. 3 hours later and again another lesson learned - ISAPI Filters can and do change the way a web server works. On the development box, they had a ISAPI filter that limited the URI to 253 characters or less.
Hence, I learn something new, often from Wade, regarding ISAPI and often in the world of filters. I leave you with this...I used to tell my engineers when I was a Technical Lead for the IIS group in WA for Microsoft that one rule existed on troubleshooting and filters - “If isn't on this list, it doesn't exist”
IIS 4.0:
sspifilt.dll: SSL Filter, fpexedll: FP Back-Compat filter
IIS 5.0:
sspifilt.dll: SSL Filter, fpexedll: FP Back-Compat filter, Compression: Compression filter, md5filt: Digest filter
IIS 6.0:
aspnet_filter.dll: ASP.Net ISAPI
Have a great day,
~Chris