Tuesday, 2 April 2013
Url ReWriting Using Url Rewriter.Net
- 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.
- Add the following in the web.config file:
- <configuration>
- <configSections>
- <section name="rewriter"
requirePermission="false"
type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter" />
</configSections>
<system.web>
<httpModules>
<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter" />
</httpModules>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule" />
</modules>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
<rewriter>
<rewrite url="~/products/(.+)" to="~/products.aspx?category=$1" />
</rewriter>
</configuration> - And in the CS file or where ever you redirect to the page from put the text as in the url field like
Response.Redirect("~/products.aspx");
0 comments :
Post a Comment