Everybody wants their website to be search engine friendly and search engine links pretty URLs. For SEO purpose Url rewriting is very important for your website. I am supporter of open-source and UrlRewriter.NET is a open source URL rewriting component for ASP.NET. All you have to do is to write just some line of codes in your web.config file.

<configuration> 
  <configSections>
    <section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration.
RewriterConfigurationSectionHandler,Intelligencia.UrlRewriter"/>
  </configSections>
  <rewriter>
    <rewrite url="~/DemoPath/(.+)" to="~/yourPage.aspx?id=$1" />
    <rewrite url="~/OtherDemoPath" to="~/Otherpage.aspx" />
    ....
  </rewriter>
  <connectionStrings>
    ....
  </connectionStrings>
    <system.web>
      <httpModules>
        <add type="Intelligencia.UrlRewriter.RewriterHttpModule,
             Intelligencia.UrlRewriter" name="UrlRewriter"/>
      </httpModules>
    </system.web>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules>
      <add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule" />
    </modules>
  </system.webServer>
  ......
</configuration>

If you are using ajax with this you may face some problem. For example, let you have a web page that accepts querystring and shows result from database based on that querystring. There is a ajax updatepanel which contains user response module which postback user comments and shows them, both inside ajax updatepanel. Now when user submits response it doesn’t work and on debug it’ll show error. This is because your urls has been rewritten and for response based on querystring you need page’s raw URL. Solution is simple. Just use this line in your master page.

protected void Page_Load(object sender, EventArgs e)

    {
        form1.Action = Request.RawUrl;
    }