httpmodules and url rewriting with no extension

  • Thread starter Thread starter Thedotnetteer
  • Start date Start date
T

Thedotnetteer

hi.
I wrote a very simple httpmodule to transform calls as
www.mysite.com/users/john
to
www.mysite.com/userspage.aspx?id=john

the problem is that my module is called only when the called page has an
..aspx extension (or an extension which is associated with aspnet), thus
making the module unuseful.

in the MSND article
"Intercept, Monitor, and Modify Web Requests with HTTP Filters in ISAPI
and ASP.NET " Panos Kougiouris says that, since IIS looks at file
extensions to redirect calls, if not provided with a file extension, the
only possible way to do the rewriting is using ISAPI filters.

I hope this is not true.

the module has been registered correctely, and it's simple structure is
liek the following.
I am sure it's easy, can somebody please help?
tnx.

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



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

}





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

System.Web.HttpApplication APP=
(System.Web.HttpApplication)sender;

APP.Context.RewritePath(.....);

}
 
its true. you can map other extensions to .net, so your handler will catch
them. the only trouble is if there is a second handler you need to call. you
will then have to host that handler yourself.

-- bruce (sqlwork.com)
 
its true. you can map other extensions to .net, so your handler will
catch them. the only trouble is if there is a second handler you need
to call. you will then have to host that handler yourself.

-- bruce (sqlwork.com)
yes, If I add the .* extension and uncheck Verify thet file exists, it
works.
tnx.
 
Back
Top