Techniques/FAQ - Error with url rewriting and IIS 6

Asked By Nagaraj muthuchamy on 25-Mar-08 05:23 AM
Hi,

I have implemented url rewriting for my site.
Its working well most of the time. but some times, It returns the 404 error.
then I refresh the page and it loads the correct page.

Environment: VS 2005,IIS 6,VB.NET,SQL Server

Thank you
Nagaraj
Sri K replied to Nagaraj muthuchamy on 12-Jan-12 10:33 AM

using System;

 

namespace Rewrite.NET {

     public class Rewrite : System.Web.IHttpModule {

 

          /// <summary>

          /// Init is required from the IHttpModule interface

          /// </summary>

          /// <param name="Appl"></param>

          public void Init(System.Web.HttpApplication Appl) {

             //make sure to wire up to BeginRequest

             Appl.BeginRequest+=new System.EventHandler(Rewrite_BeginRequest);

          }

 

          /// <summary>

          /// Dispose is required from the IHttpModule interface

          /// </summary>

          public void Dispose() {

             //make sure you clean up after yourself

          }

 

          /// <summary>

          /// To handle the starting of the incoming request

          /// </summary>

          /// <param name="sender"></param>

          /// <param name="args"></param>

          public void Rewrite_BeginRequest(object sender, System.EventArgs args) {

             //process rules here

          }

 

     }

}

http://www.15seconds.com/Issue/030522.htm