I haven't written a blog for a long time. I did not intend to discuss with my colleagues the previous day about URL rewriting. At that time, I wanted to think about it with my colleagues. Then I read it. Scott Guthrie's URL rewriting masterpiece by Scott Guthrie, founder of iis7.0 and 4guysfromrolla, came to life.
IIS can handle requests (such as HTML pages, images, and other static content) by itself, or route requests to ISAPI extensions. (ISAPI extension is an unmanaged compilation class that processes incoming Web requests. The task is to generate the content of the requested resource .)
Example
For example, when a request is sent to the info. ASP Webpage, IIS routes the message to the ASP. dll ISAPI extension. Then, the ISAPI
The extension loads the requested ASP page, executes the page, and returns the HTML to IIS. IIS then sends the HTML to the request client. For
On the ASP. NET page, IIS routes the message to the aspnet_isapi.dll ISAPI extension. Then, aspnet_isapi.dll
The ISAPI extension passes the processing operation to the managed ASP. NET auxiliary process.ProgramThe request is processed and the HTML of the ASP. NET webpage is returned.
You
You can customize IIS to specify the ing between the extension and ISAPI extension. Figure 1 shows Internet Information Services
The "application configuration" dialog box of the management tool. Note that extensions related to ASP. NET (. aspx, ascx, config, asmx, REM, Cs, and VB
And others) have been mapped to the aspnet_isapi.dll ISAPI extension.
The above is Scott Mitchell'sArticleThat is to say, if you want to rewrite ASP. NET, you must first route the program processing to ISAPI. This is what my colleagues think, and what I want is to route to ISAPI. If no configuration is configured, the HTML format file will also be processed by ISAPI, IIS will automatically process the HTML page without passing through the ISAPI, and then return the page that does not exist or other errors. This is the same as how we want to control the access permissions of HTML pages. If we want to control an HTML page, a role can access it, if we do not configure IIS, We will directly access it without a page with no permissions.
Currently, pseudo-static data and URLs are everywhere, which may be applicable to search engines. Microsoft has made major improvements in iis7.0 to cater to market needs. To achieve this effect, you only need. you can configure the config file instead of configuring it in the IIS manager, so that more users can enjoy this wonderful lunch without administrative permissions, the following is what Scott Guthrie mentioned in his blog.
ASP. NET and IIS 7.0 Integration
In earlier versions of IIS, developers need to write ISAPI
Extension/filter to expand server functions. Besides being difficult to write, ISAPI is also very limited in terms of how to access the server and allow developers to customize. For example, you cannot expand the ISAPI
Implement URL rewriting in developmentCode(Note: ASP. NET is implemented through ISAPI extension ). If you write long-running code into an ISAPI filter, you will consume
The I/O thread of the Web server (this is why we do not allow the managed code to run in the Request Filter execution phase ).
In iis7, the core IIS Processing Engine
A major architectural change is the use of a new modular request pipeline architecture to achieve extremely rich scalability. You can register an HTTP extension module (HTTP
Extensibility
Module), write code anywhere in the lifecycle of any HTTP request. These expansion modules can be written using native C ++ code or. NET managed code (you can
To use the existing ASP. NET system. Web. ihttpmodule interface ).
All built-in iis7 functions (authentication, authorization, static file supply, directory list support, classic ASP, logging, etc ), currently, this public and modular pipeline API is used for implementation. This means that you can remove any of these iis7 "built-in" functions and replace/extend these functions with your own implementations.
From iis6.0 to iis7.0 is a major improvement, not only componentized but also functional. Here we can see Scott Mitchell's article about URL rewriting: In ASP. net. At the same time, we can get the iis7.0 introduction in scottgu's Chinese Blog: IIS 7.0.