ASP. NET 4.0 in IIS6 native support URL requests without extension names

Source: Internet
Author: User

See this article of haack.ArticleASP. net mvc 3 extensionless URLs on IIS 6.Program, We can already native support URL requests without subsequent names (extensions), without the need for wildcard ing, which deploy ASP in IIS6. net MVC site is very important.

In the past, we wanted ASP. net MVC program can work normally on IIS6, or add *. MVC (or any other suffix), and add ISAPI ing rules during deployment, put *. MVC maps to aspnet_isapi.dll and submits it to ASP.. Net handler, but in general, this approach is not used, and the user experience is poor. at least so far, I have not seen a similar approach. MVC website; alternatively, we can add a wildcard ings ing (wildcard mappings) to the aspnet_isapi.dll during deployment. Its function is to submit all URL requests to ASP. net Program processing, but this makes many do not need to pass ASP.. Net requests, such as styles, scripts, images, and other static resources must go through ASP.. Net channel processing once, the consequence is may bring certain performance impact. Although not perfect, most people still choose this solution.

Now, if we use ASP. net Site is based on ASP. net 4.0, we do not need to do similar things, 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 ).

at the end of the haack article, he also mentioned that there was a small problem when he wanted to confirm such behavior, but it was just a few steps to fix these problems. This error may occur when ASP. NET 4.0 is installed and some IIS registration behaviors are not correctly executed. However, I do not have the IIS6 environment for verification, but I believe this function is very meaningful for deploying ASP. NET MVC sites in IIS6.

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.