Previously, when URLRewrite is used in IIS6, everything works normally, but it cannot be used normally in IIS7. The system prompts "The resource cannot be found". In this case, you need. system. configure the handlers node in the webServer node as follows:
Configuration in IIS6:
Code
1 <configuration>
2
3 <configSections>
4 <section name = "RewriterConfig" type = "URLRewriter. Config. RewriterConfigSerializerSectionHandler, URLRewriter"/>
5 </configSections>
6 <RewriterConfig>
7 <Rules>
8 <RewriterRule>
9 <LookFor> ~ /Index \. aspx </LookFor>
10 <SendTo> ~ /Content/Index. aspx </SendTo>
11 </RewriterRule>
12 </Rules>
13 </RewriterConfig>
14
15 <system. web>
16 17 <add verb = "*" path = "*. aspx" type = "URLRewriter. RewriterFactoryHandler, URLRewriter"/>
18 19 </system. web>
20
21 </configuration>
To use IIS7, add the following content to web. config:
Code
1 <configuration>
2
3 <system. webServer>
4 <validation validateIntegratedModeConfiguration = "false"/>
5 <modules>
6 <add type = "URLRewriter. ModuleRewriter, URLRewriter" name = "ModuleRewriter"/>
7 </modules>
8 <system. webServer>
9
10 </configuration>
After the above Code is added, URLRewrite can be used in IIS6 and IIS7 at the same time.
-- EricZhang