Using httpmodules to override URLs (Principles)

Source: Internet
Author: User

It is said that using httpmodules can be similar:Http://www.infotouch.cn/detail.aspx? Id = 120The URL address of is rewritten:Http://www.infotouch.cn/detail/120.aspx. The most direct advantage is that the search engine can search for pages, because the search engine is? The subsequent parameters are ignored.

Today, I tried to find out that httpmodules can only rewrite URLs with specific extensions (Note: Only ing-ApplicationProgramExtension), find some English documents from Google, and find that this situation is determined by the mechanism of IIS processing requests.

How IIS processes requests for URLs without extensions:

If the request path has an extension, IIS first checks whether the corresponding application extension has been set. If yes, it gives control to the application:
SoHttp://www.infotouch.cn/detail.aspx? Id = 120This situation can be easily handled as longHttp://www.infotouch.cn/detail/120.aspxYou can. This is because IIS handed over control of *. aspx extensions to ASP. NET and then to httpmodules.

If the requested path does not have an extension, for example:Http://www.infotouch.cn/detailSuch a path. IIS first checks whether the virtual path corresponds to a local directory. If a local directory exists, it checks whether the directory has a default file. If yes, the default file path. Otherwise, IIS reports an http404-File Failure error.

Next, read practice.

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.