Configure pseudo-static web. config

Source: Internet
Author: User

Copy codeThe Code is as follows:
<? Xml version = "1.0" encoding = "UTF-8"?>
<Configuration>
<! -- Register the url rewriting module in the top part of webconfig -->
<ConfigSections>
<Section name = "RewriterConfig" type = "URLRewriter. Config. RewriterConfigSerializerSectionHandler, URLRewriter"/>
</ConfigSections>
<! -- Step 2 add Rewrite Rules -->
<RewriterConfig>
<! -- Create all rewrite rules first -->
<Rules>
<! -- Create rules for each individual page -->
<RewriterRule>
<! -- Original request address -->
<SendTo> <! [CDATA [~ /News. aspx? Id = $1 & pid = $2]> </SendTo>
<! -- Rewrite address -->
<LookFor> ~ /News/(. [0-9] *)/(. [\ d] *) \. html </LookFor>
</RewriterRule>
<RewriterRule>
<! -- Original request address -->
<SendTo> <! [CDATA [~ /Product. aspx? Pid = $1]> </SendTo>
<! -- Rewrite address -->
<LookFor> ~ /Product/(. [\ d] *) \. zangdalei </LookFor>
</RewriterRule>
</Rules>
</RewriterConfig>
<System. web>
<Compilation debug = "false" targetFramework = "4.0">
<! -- The fourth part of url rewriting prevents real pages from being overwritten. If the website contains real pages, you need to add compilation instructions to not compile real html files. -->
<BuildProviders>
<Add extension = ". html" type = "System. Web. Compilation. PageBuildProvider"/>
</BuildProviders>
</Compilation>
<! -- The third part is url rewriting. the user's request page is handed over to the corresponding handler. Pay attention to the request suffix format. -->
<HttpHandlers>
<Add verb = "*" path = "*. html" type = "URLRewriter. RewriterFactoryHandler, URLRewriter"/>
<Add verb = "*" path = "*. zangdalei" type = "URLRewriter. RewriterFactoryHandler, URLRewriter"/>
</HttpHandlers>
</System. web>
<System. webServer>
<Handlers>
<Add name = "aspnethtml" path = "*. html "verb =" GET, POST "modules =" IsapiModule "scriptProcessor =" C: \ Windows \ Microsoft. NET \ Framework \ v4.0.30319 \ aspnet_isapi.dll "resourceType =" Unspecified "preCondition =" classicMode, runtimeVersionv4.0, bitness32 "/>
<Add name = "aspnetzangdalei" path = "*. zangdalei "verb =" GET, POST "modules =" IsapiModule "scriptProcessor =" C: \ Windows \ Microsoft. NET \ Framework \ v4.0.30319 \ aspnet_isapi.dll "resourceType =" Unspecified "preCondition =" classicMode, runtimeVersionv4.0, bitness32 "/>
</Handlers>
<Defadocument document>
<Files>
<Clear/>
<Add value = "default. aspx"/>
<Add value = "default.html"/>
</Files>
</Defadocument document>
</System. webServer>
</Configuration>

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.