Benefits of url rewriting:
1. Easy to search by the search engine (html-format website search engines have the highest priority, and seo optimization is better)
2. the url is simpler and easier to remember.
3. Hide the actual website path strength and specific development technologies
Use URLRewriter. dll to override
After URLRewriter. dll is used, you only need to use the following steps to rewrite the url.
1. Write in webconfig
Copy codeThe Code is as follows: <Rules>
<! -- Rule 1 -->
<RewriterRule>
<LookFor> ~ /D (\ d +) \. html </LookFor>
<SendTo> ~ /Default. aspx? Id = $1 </SendTo>
</RewriterRule>
</Rules>
Page display is ~ /Default. aspx? Id = 5, auto or converted ~ /D5.html, which is restricted by regular expressions.
2. Configure httpmodel
Copy codeThe Code is as follows: <Add type = "URLRewriter. ModuleRewriter, URLRewriter" name = "ModuleRewriter"/>
</HttpModules>
Windows2003 Server Configuration:
Website> Properties> directory> Configuration (G)> ing> wildcard application ing> insert
Executable File: C: \ WINDOWS \ Microsoft. NET \ Framework \ v2.0.50727 \ aspnet_isapi.dll
Check whether the file exists: No