By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,687 Members | 2,055 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,687 IT Pros & Developers. It's quick & easy.

Using ISAPI filter with .net for URL Rewriting

P: n/a
Hi All,

I've been looking into options for URL Rewriting in .net, and to be honest,
I haven't seen anything that's easier than the old Classic Asp solution with
an ISAPI filter redirecting to an .asp page with responsibility for handling
the redirect.

I'm now planning to use this solution with my next .net project, and was
wondering if anyone else out there has done this already, and what problems
(if any) arise. Hopefully the news is that the solution works just as
easily as before.

I *am* aware that there is a dotnet alternative to an ISAPI filter. I found
a decent Scott Mitchell article
(http://msdn.microsoft.com/library/de...-us/dnaspp/htm
l/urlrewriting.asp) on a URL Rewriting using Http modules, but I have some
reservations about using this method:

(a) it seems a lot more complex than the ISAPI solution.
(b) if you want to be able to handle URL's of the form
"www.apple.com/products", you still have to create a physical "products"
folder AND put an empty Default.aspx file in it, neither of which are true
of the ISAPI solution.
(c) depending how you implement the .net solution, Forms or Windows
Authentication may cease to work.
(d) to solve a postback issue you have to use an Actionless Server-side Form
instead of the standard .net one throughout your site.

So, does anyone have experience using an ISAPI Filter with .net, and was it
a good, bad or indifferent experience?

TIA,

JON

PS First posted to aspmessageboard:
http://www.aspmessageboard.com/forum...31069&F=36&P=1

Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
HI Jon:

a) The complexity depends on how much you want to do with the URL
re-writing. To me, URL rewriting from managed code isn't even in the
same order of complexity as an ISAPI filter. An HttpModule is easier
to configure, easier to write, easier to debug, and more robust at
runtime.

b) You can avoid creating physical directories by mapping all requests
through the ASP.NET runtime (in the script map settings of IIS).

c) This I have not seen a problem with, but you would have to be
careful where the RewritePath occurs, I imagine the same could be said
of the ISAPI solution.

d) Scott's article is great, but it does miss one simple solution to
this problem. Once you are inside the destgination page, simply
rewrite the path back to the original raw URL. This does not actually
'redirect' the request, but it does allow the runtime to write out the
correct action attribute in the form tag. It's a simple, one line
solution to the problem. I blogged about this here:

The Passion and the Fury of URL Rewriting
http://odetocode.com/Blogs/scott/arc...09/22/509.aspx

HTH,

--
Scott
http://www.OdeToCode.com/
On Wed, 29 Sep 2004 11:08:23 +0100, "Jon Maz" <jo****@surfeuNOSPAM.de>
wrote:
Hi All,

I've been looking into options for URL Rewriting in .net, and to be honest,
I haven't seen anything that's easier than the old Classic Asp solution with
an ISAPI filter redirecting to an .asp page with responsibility for handling
the redirect.

I'm now planning to use this solution with my next .net project, and was
wondering if anyone else out there has done this already, and what problems
(if any) arise. Hopefully the news is that the solution works just as
easily as before.

I *am* aware that there is a dotnet alternative to an ISAPI filter. I found
a decent Scott Mitchell article
(http://msdn.microsoft.com/library/de...-us/dnaspp/htm
l/urlrewriting.asp) on a URL Rewriting using Http modules, but I have some
reservations about using this method:

(a) it seems a lot more complex than the ISAPI solution.
(b) if you want to be able to handle URL's of the form
"www.apple.com/products", you still have to create a physical "products"
folder AND put an empty Default.aspx file in it, neither of which are true
of the ISAPI solution.
(c) depending how you implement the .net solution, Forms or Windows
Authentication may cease to work.
(d) to solve a postback issue you have to use an Actionless Server-side Form
instead of the standard .net one throughout your site.

So, does anyone have experience using an ISAPI Filter with .net, and was it
a good, bad or indifferent experience?

TIA,

JON

PS First posted to aspmessageboard:
http://www.aspmessageboard.com/forum...31069&F=36&P=1


Nov 18 '05 #2

P: n/a
Very helpful Scott, many thanks.

JON
Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.