Today, my colleague asked me to help him go to the server to see why the 404 error occurred after he put the page pseudo-static. Why did this problem occur? After careful research, I found that the reasons are as follows:
Because ASP. during the installation process of NET4.0, some operations have been done on IIS6 so that it can support native URL requests without a suffix. So what exactly does NET4.0 do? In this blog by Thomas Marquardt, the author of this function explains how it works, probably like this:
ASP. NET 4.0 registers an ISAPI Filter in IIS6, called "aspnet_filter.dll" during installation. The ISAPI Filter is executed before the ISAPI processing program, it will add a string of characters "/eurl after all URLs without a suffix. axd/GUID ", ASP. NET 4.0 will also add a request ing rule "*. axd ", ing to aspnet_isapi.dll. In this case, add "/eurl" to all URLs without a suffix. the axd/GUID will be changed to a tape. *. axd ing rules for ASP.. NET processing channel. Go to ASP. NET channel, ASP. NET handler will delete "/eurl. axd/GUID "to restore it to the original situation without a suffix, and will not affect subsequent request processing. In this case, all requests without a suffix enter ASP. NET processing channel, by default, ASP. NET4.0 global web. defaultHttpHandler is configured in config to receive URL requests without a suffix, but we can also change the default handler (such as ASP.. net mvc handler) to process URL requests without a suffix.
From the above explanation, it is not difficult to see that this is essentially different from the IIS7 integration model, and it is not a very native processing solution. I have to say that this is not a very smooth solution, and it may not be a great solution. But in fact, before ASP. net mvc was available, the support for URL requests without suffixes was not so urgent. Even if necessary, a URL Rewriter component is used. Because the ASP. NET processing channel is required first, the URL Rewriter component also needs to be extended at the ISAPI level. When we are in ASP. NET 4.0 programs, when similar components are required, they may need to be in conflict with the above functions. At this time, we may need to disable ASP. NET4.0 provides this function for URL requests without a suffix. At this time, you may modify the key value of the registry (and restart IIS), or delete the registration of aspnet_filter.dll (because/eurl. axd/GUID is added in this step ).
Solution:
Open the registry and find "HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ ASP. NET \ 4.0.30319.0 ", add a key value of the" EnableExtensionlessUrls "type as" DWORD ", and set the value to" 0 ". Run "IISRESET" in cmd and restart IIS to read the modified content in the registry. Note: This modification is to disable ASP. NET 4 extension. 0 for non-extended URL Processing. If this key value is set to "1", it is enabled.