IIS 5 & IIS 6
Configuration & Scripting
Configure IIS to Process All Requests through the ASP.NET 2.0 ISAPI F...
Last post Aug 09, 2006 03:23 PM by tomkmvp
Aug 07, 2006 08:19 PM|drazz75|LINK
I am doing some URL rewriting without file extensions and I am coming up against a problem where the ASP.NET ISAPI filter is not invoked on a request with no file extension in the request URL.
I tried this option:
But again, the extension assumes that you have some sort of file extention to map to.
My rewriter works like this:
/shows/architectajax/ ---> /shows/default.aspx?name=architectajax
My question is... how do I configure IIS to process all requests including those without a file extension?
Aug 07, 2006 09:24 PM|tomkmvp|LINK
Aug 07, 2006 09:54 PM|drazz75|LINK
Aug 08, 2006 03:31 AM|steve schofield|LINK
You would need to configure the wildcard mapping in IIS6. As Tom mentioned, you will need to handle unique cases where a file and folder with the same name can be separated. This would be handled by using an HTTP Module / HTTP Handler.
Windows Server MVP - IIS
Log archival solution
Install, Configure, Forget
Aug 08, 2006 03:14 PM|steve schofield|LINK
I recall a "feature" when trying to configure WinXP with a wildcard entry this needed to be done using a script. I tested on my WinXP machine and was able to add a wildcard script mapping. As always, I recommend trying on a non-critical
machine before doing on your production to ensure this meets your needs.
1) Download this script, save to an .VBS file
2) <SCRIPName.vbs> W3SVC/1/root/ScriptMaps "" C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,0" /INSERT /COMMIT
3) Try it out.
Aug 09, 2006 12:09 AM|steve schofield|LINK
As far as I can tell, files with no extension are not handled by the wildcard isapi-filter, unless it is specifically intercepted and handled by an HTTP Module or HTTP Handler. A workaround is to map the 404 custom error document (this could be an aspx
page) in IIS to have this work. I tested on my local machine and if I had the IIS 404 custom setting using the default config, the normal 404 message was displayed. If I changed it to the error handling document I could have requests with no extensions
and the error webpage I defined came up.
Here is a good explaination of the request process for IIS by David Wang. MSFT guru, if he is monitoring this thread, he might know or better explain it.
As I read his posting, if you have an HTTP Module / Handler coded to handle all wildcard entries, your webpage could call or invoke (probably not the right wording but hopefully you know what I mean) to process the request. Then the request would not need
to use the IIS 404 setting. I'm not 100% sure on that however. I've not done advanced level HTTP Modules / HTTP Handlers that intercept the HTTP request early in the request cycle. I have but its not been in asp.net 2.0. Here are some links to that explain
this topic. I hope that helps provide a couple of options / ideas to achieve what you want.
Aug 09, 2006 12:20 AM|steve schofield|LINK
Here is an article I wrote that explains using the built-in features of IIS to handle 404 errors and .NET'ish way. This is one options as best I can tell to achieve what you want.
Aug 09, 2006 01:13 PM|tomkmvp|LINK
So the idea is ... given this request "/shows/architectajax", if a 404 is generated because the architectajax folder doesn't exist the request gets redirected to:
Is that what you're thinking?
Aug 09, 2006 02:20 PM|drazz75|LINK
Yes. I even tried this technique on my WinXP machine and it didn't work, but I will attempt it on a Win2K3 server later this afternoon.
Steve - thank you so much for your help. I'll let you know what I find.
Aug 09, 2006 03:23 PM|tomkmvp|LINK