Iis7.5+webconfig implement page pseudo-static and 301 redirect
Use the Urlrewriter component in Windows 2003 +iis 6.0 to configure the pseudo-static articles on the network in a large heap. However, in the iis7.0 or IIS 7.5 environment configuration of the site basically did not explain, even if there are some useless code snippet, today is very easy to configure the success, send a diary sharing experience.
Document Download: http://files.cnblogs.com/files/dunitian/IIS7.5_WebConfig%E5%AE%9E%E7%8E%B0%E9%A1%B5%E9%9D%A2%E4%BC%AA%E9% 9d%99%e6%80%81%e5%92%8c301%e9%87%8d%e5%ae%9a%e5%90%91.zip
- Download Urlrewriter Components ( dots ) First
Http://download.microsoft.com/download/0/4/6/0463611e-a3f9-490d-a08c-877a83b797cf/MSDNURLRewriting.msi
- To add a reference to a Urlrewriter assembly in a Web site project
- Configuring the Webconfig File
( 1 ) in <configuration> with the </configSections> node Intermediate settings:
<section name= "Rewriterconfig" type= "URLRewriter.Config.RewriterConfigSerializerSectionHandler, Urlrewriter"/ >
( 2 ) in the middle of and node settings:
<add name= "shtml" verb= "*" path= "*.shtml" type= "Urlrewriter.rewriterfactoryhandler, Urlrewriter"/>
<add name= "html" verb= "*" path= "*.html" type= "Urlrewriter.rewriterfactoryhandler, Urlrewriter"/>
( 3 ) in the middle of and node settings:
<add type= "Urlrewriter.modulerewriter, Urlrewriter" name= "Modulerewriter"/>
( 4 syntax for rule configuration:
in the <configuration> with the </configuration> join between <RewriterConfig></RewriterConfig> node.
in the <RewriterConfig> with the </RewriterConfig> To add a rule between:
<!--urlrewriter detailed configuration rules section starts -
<RewriterConfig>
<Rules>
<!-- pseudo-static configuration starts -
<!-- defining pseudo-static first rule Data Download Detail Page -
<RewriterRule>
<lookfor>^ (. *)/downloadshow/([0-9]+) \.shtml$</lookfor>
<SendTo>$1/Downloadshow/$2</SendTo>
</RewriterRule>
<!-- define pseudo-static second rule School Course Details Page -
<RewriterRule>
<lookfor>^ (. *)/s-coursedetail/([0-9]+) \.shtml$</lookfor>
<SendTo>$1/schoolsite/courseDetail/$2</SendTo>
</RewriterRule>
<!-- definition 301 Redirect The first rule Data Download Detail Page -
<RewriterRule>
<lookfor>^ (. *)/downdetail-([0-9]+) \.html$</lookfor>
<SendTo>$1/_301Deal/DownDetail/$2</SendTo>
</RewriterRule>
<!-- definition 301 REDIRECT second rule School Menu List Page -
<RewriterRule>
<lookfor>^ (. *)/xuexiao-(\w+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-\.html$</lookfor>
<SendTo>$1/_301Deal/SchoolList/$2-$3-$4-$5-$6-$7</SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
<!--urlrewriter detailed configuration rule section ends -
~~~ Wrap up ~ ~
Iis7.5+webconfig implement page pseudo-static and 301 redirection