I really had to deal with the same problem while developing my Rewriter URL . This is due to processes that take place before you can even access the URL. To get around this, you must ensure that page processing is disabled by default in IIS 7. Because, if there is no default processing by default, it is not going to go through an extra step, trying to map it to the disk, so you will be the exact requested URL. But this may or may not be an option, depending on whether you use System.Web.Routing or not.
To disable default page processing, you need to do the following:
- Go to your site in IIS
- Go to the default Document
- Click Disable in the upper right corner.
Or you can add the following to your web.config :
<system.webServer> <defaultDocument enabled="false" /> </system.webServer>
After that, the default document will no longer be added to your URL. However, it should be warned that since it is no longer active, you cannot rely on the actual mapping of default.aspx to your directories, you will have to process it manually or use something like System.Web.Routing to handle this function.
To accomplish the same thing in IIS 6, you need to include wildcards:
For IIS 6, the following instructions apply.
- Open IIS and right-click on the website and select "Properties."
- Click the "Configure" button in the "Application Settings" section.
- Click the "Insert ..." button to create a new lookup mapping
- Install the executable text file in the location of the aspnet_isapi.dll file. for .net 2.0, 3.0, 3.5: C: \ Windows \ Microsoft.NET \ Framework \ v2.0.50727 \ aspnet_isapi.dll
- Make sure that the "Verify that the file exists" checkbox is not selected.
- Click "OK" to confirm and close all windows.
NOTE: by the way, the entire source is available on the site where I linked above, and you were curious how I do it.
source share