MVC series (Ten) MVC why no longer need to register the wildcard character (*.*)

Source: Internet
Author: User
Tags root directory

In many tutorials, it is mentioned that when you deploy an MVC program, you configure the wildcard mapping (or *.MVC) to Aspnet_ispai.dll, which is really supposed to be so much before. NET4.0, but. NET4.0 don't bother anymore, because it's supported by default.

You can ask, no mapping configuration, the request is so likely to go to the Aspnet_ispai.dll? Yes, that's one thing we're going to talk about in this chapter: asp.net 4 extensionless URL feature, because after Asp.net4, all requests are turned to Aspnet_ispai.dll, so how does it work in IIS6? First, a aspnet_filter.dll is automatically installed when asp.net4.0 is installed, which is an ISAPI filter that appends all URL addresses to the/eurl.axd/guid string before the request is processed, and by default *. The Axd extension is mapped to the aspnet_isapi.dll, so when we attach the/EURL.AXD/GUID string, all requests can be aspnet_isapi.dll processed, and when entering the ASP.net, the The Eurl.axd/guid string was deleted (this cycle is very early) to revert to the original URL address. NET Framework root directory Web.config default settings request is Defaulthttphandler to handle, because its path= "*", and placed in httphandlers first position (unless you modify the settings), thereafter Defaulthttphandler this request forward (not URL jump OH) to IIS, this time our filter will not attach/eurl.axd/guid string, then the normal processing request, if you want to use this feature to do other special things, Then you need to modify defaulthttphandler for other HttpHandler before the Maprequesthandler event is executed.

One thing to note is that in IIS7 integration mode, the default handler for processing requests is not Defaulthttphandler but Transferrequesthandler, two hanlder is similar, The details are different from the scope of our discussion, we will not say more, these handler by default. NET4.0 installed together, but IIS7 default is not enabled this feature, only the QFE installed IIS7 can be used, QFE included in the service pack, QFE independent download address for http://support.microsoft.com/kb/980368.

This column more highlights: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/aspx/

In addition, the following settings need to be met if you want to keep this function working:

Enableextensionlessurls is not defined or is set to a value of 1.

v4.0 Aspnet_filter.dll is normally registered to IIS as the Ispai filter.

v4.0 aspnet_isapi.dll processing. axd extension request, that is,. Axd map to Aspnet_ispai.dll.

The v4.0 Aspnet_isapi.dll is set to allow allowed in the Ispai limit list.

The Web site is set to readable and has script permissions.

To disable this feature on the IIS6, modify the registry file Hkey_local_machine\software\microsoft\asp.net\4.0.30319.0\enableextensionlessurls 0 to achieve Because IIS loads this configuration only when it reboots, so it requires a reboot to take effect. WOW64 (for example, 64 is allowed for 32-bit worker process under OS) you need to set hkey_local_machine\software\wow6432node\microsoft\asp.net\4.0.30319.0\ Enableextensionlessurls is 0.

IIS 6, asp.net 4, and ASP.net MVC 3 can successfully use these features (even MVC2 can, MVC1 not tested), so you can use the asp.net4.0 feature without having to set up the wildcard mapping when you deploy the site on MVC3 later.

Cnblogs, Uncle Tom.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.