Use Mircosoft urlrewriter. DLL to implement pseudo-static Asp.net pages

Source: Internet
Author: User

Yesterday, I posted an article about using ISAPI filter to implement URL pseudo-static Article I did it according to the content in the article, but it does not appear that this method does not use Microsoft urlrewriter. the DLL method is good. At least I personally think it took me a night to finally find out how to use this DLL file to implement static on the Asp.net page, which is actually very simple.
1. Obtain Mircosoft urlrewriter. dll:
You can obtain Mircosoft urlrewriter. dll from http://www.microsoft.com/china/msdn/library/webservices/asp.net/URLRewriting.mspx? MFR = true
here, select [onclick = "javascript: track ('ctl00 _ rs1_maincontentcontainer_ctl00 | ctl00_rs1_maincontentcontainer_ctl01 ', this ); "href =" http://download.microsoft.com/download/0/4/6/0463611e-a3f9-490d-a08c-877a83b797cf/MSDNURLRewriting.msi "> download the source code of this article], after the download, import the project, I did not make any changes to this project, retain the original rewrite method, then it is generated directly in vs2005. DLL file.
2. Use the DLL file:
Add a reference.
3. Page design. I will release a download package. If you are interested, download it, Code is messy.
4. Web. config configuration
This is critical and is critical to the success of static configuration.






~ /Web/New/type/(. [0-9] *) \. html
~ /Web/New. aspx? Id = 1

~ /Web/index.html
~ /Web/index. aspx









Here is a brief introduction: <rewriterconfig>
<Rules>
<Rewriterrule>
<Lookfor> the mode to be searched </lookfor>
<Sendto> string used to replace the mode </sendto>
</Rewriterrule>
<Rewriterrule>
<Lookfor> the mode to be searched </lookfor>
<Sendto> string used to replace the mode </sendto>
</Rewriterrule>
</Rules>
</Rewriterconfig>

Httphandlers is mainly used in combination with IIS to redefine and process requests. This is also critical. If there is no reasonable httphandlers, the access will certainly fail.

You can search for regular expressions in Baidu: "common regular expressions", there will be many.

5. Configure the iis .html File
Right-click my computer> Manage> Expand services and applicationsProgram'--> Internet Information Service --> Find the shared directory --> right-click Properties --> click 'configuration' --> map to the following --> Find. aspx executable file path copy path --> paste path --> the extension is ". html "--> then remove the check object check box. If the" OK "button becomes invalid, you can use the keyboard event editing path to solve the problem.

Download this example:Http://files.cnblogs.com/zhangyi85/StaticWeb.rar

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.