URL rewriting

J

Juha Borenius

I read Robert Chartier's article from 15 seconds
(http://www.15seconds.com/issue/030522.htm) and tried it myself. URL
rewriting seems to work fine as long as original file exists. For example:
redirecting from /mysample/default.html to /mynewsample/default.html works
when original file exists. But when original file doesn't exist or request
file is not specified (requesting for a directory /mysample/), IIS throws an
error. Seems that HttpModule doesn't get OnBeginRequest -event at all.

Is there any way to work around this problem?
Is there any ready ISAPI filters for URL rewriting?

Regards,
Borre
 
R

Ram

Use Global_PreRequestHandlerExecute method in Global.asax.
This fires for every request, there you can write your code to create
the URL and use response.redirect

Ram
 
C

Colin Young

AFAIK, the ASP.Net engine only handles the request if it is mapped as the
handler for the file type. Since fake directories are not mapped to any
handler, the IIS 404 mechanism takes care of it. You would need to configure
IIS to use a custom 404 page in order to have all possibilities handled by
your code.

Also see MSDN Magazine from August 2002. There is an article by Panos
Kougiouris about this topic.

Colin
 

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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top