Configuration
- Open your web project in Microsoft Visual Studio .NET.
- Add a reference to the Intelligencia.UrlRewriter assembly.
- Open the web.config file in your web project.
- At the top of the file, add a configuration section handler:
<configSections> <section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration.
RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter” />
</configSections>This enables the UrlRewriter.NET to read its configuration from the rewriter node in the web.config file.
- Add rewriter HttpModule:
<system.web> <httpModules> <add type="Intelligencia.UrlRewriter.RewriterHttpModule,
Intelligencia.UrlRewriter”
name=”UrlRewriter” />
</httpModules>
</system.web>This enables UrlRewriter.NET to intercept web requests and rewrite URL requests.
- Add some rules to your web.config file:
<rewriter> <rewrite url="/tags/(.+)" to="/tagcloud.aspx?tag=$1" /> </rewriter>
The syntax of the rewriter section is very powerful. Refer to the reference for more details of what is possible.
- Compile and test!