This series of directories
Because I found a lot of this information on the Internet.ArticleAnd the importance of Seo In urlrewrite is gradually decreasing, so this section is easier to write. The following are the key points:
1. urlrewrite, as its name implies, is only a URL rewriting operation. do not consider it as a scheme? Author = Jack & id = 2467. Therefore, some people have called this technology "pseudo-static" in the past. Of course, since there is a "pseudo" technology, it is true, that is, I/O operations, generate an HTML file based on user input, database query, and so on. This technology is no longer discussed in this series (and I personally think it is of little value ).
2. Convert www.freeflying.com/jack/articles-2467.html to www.freeflying.com/articles.aspx? Author = Jack & id = 2467, certainly cannot be completed in the page events we are used. Because without conversion, we cannot reach the limit. Therefore, the conversion will be performed in the "ApplicationProgramCompleted in lifecycle.
There are two specific implementation methods: Global. asax and httpmodule; but they all adopt the same method: rewritepath ().
For global. asax or httpmodule, many people think that httpmodule is more efficient, but I cannot understand it. According to msdn, "If we create global. asax file, which will be compiled into an httpapplication derived class, And the httpapplicant derived class replaces the default httpapplication instance to maintain the application. When an httpapplication instance is created, all the httpmodules registered in Web. config are also created. Then, the init () method of httpapplication is called ." "The httpapplication instance maintains a pipeline to verify request requests and cache requests in sequence." The most common events are beginrequest events (in urlrewrite, this method is called ), procesrequest () method (the method that must be implemented in httphandler ). Therefore, I think that httpapplication (including the Global. asax file) "contains" containers "of application events, httpmodule, and httphandler ". RegardlessCodeWritten in global. asax or httpmodule, the performance is the same.
3. As shown in the Code, if there is only one or several conversions, we can use expressions like If. What if there are thousands of conversions? As you can imagine, ID is the auto-increment field of a table in the database. Is there an automatic processing mechanism that allows us to intelligently convert URLs? Yes, it is a well-known regular expression. We will explain in the next special section.
Finally, I found some good reference links:
Is urlrewrite necessary? Google official explanation
"Url routing" in ASP. net4.0 is said to be able to implement the same functions as URL rewrite.
The urlrewrite implementation mechanism of Lao Zhao's blog in the garden
Or Lao Zhao, probably a blog written after being mad by seoer