Solution for iirf overwriting partially failed in ASP. net4.0 + IIS6

Source: Internet
Author: User

Recently, the company started a new project using Asp.net mvc3, ASP. net4.0, and IIS6. Because IIS6 does not support paths without extension. So I thought of using URL rewriting.

The idea is as follows: add in IIS. the MVC extension is mapped to c: \ windows \ Microsoft. net \ framework \ v4.0.30319/aspnet_isapi.dll, you can use/home. MVC/index path, and then rewrite with URL

Rewriterule ^/home/index/$/home. MVC/index/[I, L, u]

This solves the above problems. However, the Error 404 is always displayed in practice.

The reason is as follows:

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.

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

 

Solution: Remove aspnet_filter.dll.

Http://www.asp.net/learn/whitepapers/aspnet4/breaking-changes#0.1__Toc256770153

If it is not practical to remap the web site to ASP. NET 2.0 or to change the location of a virtual directory, explicitly disable extensionless URL Processing in ASP. net 4. use the following procedure:

  1. In the Windows registry, open the following node:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET\4.0.30319.0

  1. Create a newDWORDValue namedEnableextensionlessurls.
  2. SetEnableextensionlessurlsTo 0. This disables extensionless URL behavior.
  3. Save the registry value and close the registry editor.
  4. RunIisresetCommand-line tool, which causes IIS to read the new registry value.

 

 

 

 

Related Article

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.