Using ISAPI filter with .net for URL Rewriting

Discussion in 'ASP .Net' started by Jon Maz, Sep 29, 2004.

  1. Jon Maz

    Jon Maz Guest

    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/default.asp?url=/library/en-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/ASPPlus.asp?M=731069&T=731069&F=36&P=1
    Jon Maz, Sep 29, 2004
    #1
    1. Advertising

  2. Jon Maz

    Scott Allen Guest

    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/archive/2004/09/22/509.aspx

    HTH,

    --
    Scott
    http://www.OdeToCode.com/


    On Wed, 29 Sep 2004 11:08:23 +0100, "Jon Maz" <>
    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/default.asp?url=/library/en-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/ASPPlus.asp?M=731069&T=731069&F=36&P=1
    >
    >
    Scott Allen, Sep 29, 2004
    #2
    1. Advertising

  3. Jon Maz

    Jon Maz Guest

    Very helpful Scott, many thanks.

    JON
    Jon Maz, Sep 30, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael Shutt
    Replies:
    0
    Views:
    782
    Michael Shutt
    Jun 26, 2003
  2. =?Utf-8?B?U2VyZw==?=

    How to install ISAPI filter for Url Rewriting?

    =?Utf-8?B?U2VyZw==?=, Mar 28, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    535
    =?Utf-8?B?U2VyZw==?=
    Mar 29, 2005
  3. Dan
    Replies:
    0
    Views:
    343
  4. Jeeran
    Replies:
    4
    Views:
    1,198
    Steven Cheng[MSFT]
    Jul 6, 2006
  5. trooperbill

    does url rewriting use isapi

    trooperbill, Aug 1, 2006, in forum: ASP General
    Replies:
    5
    Views:
    132
Loading...

Share This Page