473,386 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

httpmodules and url rewriting with no extension

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

}
Nov 18 '05 #1
2 2258
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)
"Thedotnetteer" <no*****@NONONO.no> wrote in message
news:Xn************************@193.70.192.192...
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(.....);

}

Nov 18 '05 #2
"bruce barker" <no***********@safeco.com> wrote in
news:e5**************@TK2MSFTNGP09.phx.gbl:
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.
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Juan Stang | last post by:
I'm trying to implement some kind of page controller, a class that will intercept all incoming requests and route them appropriately. More specifically, I'd like to intercept a request for a...
11
by: Markus Kling | last post by:
Hi, I have a web application that has two sub-applications. The root application defines two httpModules which shall not be loaded for the subapplications. I tried to achieve this by adding ...
0
by: tshad | last post by:
I noticed in my Http modules that all the BeginRequests are handled for each Module before the EndRequests is handled (at least that seems to be the case). I have 2 HttpModules each with...
1
by: Anonieko | last post by:
Global.asax? Use HttpModules Instead! In a previous post, I talked about HttpHandlers - an underused but incredibly useful feature of ASP.NET. Today I want to talk about HttpModules, which are...
3
by: Greg Collins [Microsoft MVP] | last post by:
I have done a bit of research of Url Rewriting, but as yet have been unsuccessful at getting it to work well, and there are issues around what file types are supported and how much code you want to...
1
by: craigkenisston | last post by:
According to this guys here: http://tinyurl.com/ygjxry "You can use different URL styles: * http://www.myweb.com/products/nokia * http://www.myweb.com/products/nokia.aspx *...
8
by: rapiddata | last post by:
//reposting because of spelling mistake in "rewritting" in original post Is there a way to rewrite urls that have no extensions in the url, i.e. no ..aspx or no .html like...
6
by: =?Utf-8?B?bXVzb3NkZXY=?= | last post by:
Hi I've created a website in VS2005 with the in-built server, which uses an httpModule for UrlRewriting (using a hook into BeginRequest, doing everything by hand). I've recently transfered...
1
Shinobi
by: Shinobi | last post by:
I am using ASP.net(c#) for my project. In my my project 2 pages are using URL rewriting method by referring this article URL Rewriting using Intelligencia UrlRewriter Example 1 - Blog Day...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.