httpmodules and url rewriting with no extension

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(.....);

}
 
B

bruce barker

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)
 
T

Thedotnetteer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top