URL Mapping

Discussion in 'ASP .Net' started by =?Utf-8?B?SmluZ3hpIENoZW4=?=, Mar 24, 2005.

  1. I want mapping any url to a certain .dll to process. For example I want all
    requests to URL http://myserver/vpath1 or http://myserver/vpath1/anyfile be
    redirected to myhandler.dll to handle. One important thing is that the URLs I
    want to redirect may not physically exit, they could be just virtual URLs.

    Thanks!
     
    =?Utf-8?B?SmluZ3hpIENoZW4=?=, Mar 24, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?SmluZ3hpIENoZW4=?=

    Tim_Mac Guest

    hi Jingxi,
    i wrote an ISAPI filter that does just what you describe. the reason i
    used ISAPI was because i wanted to have virtual folder URLs aswell as
    page urls. so you can have myserver/Folder1/Folder2/ which gets
    redirected to your DLL for server processing or whatever.
    i have it set up to intercept all .html requests and requests for a
    default document (i.e. for a folder) and to redirect them to
    /content.aspx?Url=THE_ORIGINAL_URL.HTML

    it ignores all other types of requests, .aspx, .asmx, .jpg etc.
    you can see how i did it on my blog, and download the ISAPI filter. if
    you have VS.Net, you can modify the solution to whatever you need.
    http://tim.mackey.ie/PermaLink.aspx?guid=f3050e59-636f-4634-8a2b-8b1c0de17a5b

    there are easier ways using the .Net framework, like setting up a new
    script mapping for a file extension in IIS, i.e. you can set IIS to
    treat .html files as .aspx files. but none of these options work with
    non-existent foleder URLs. also, this filter logs the original url
    that was requested, instead of /content.aspx?whatever... for each
    request. the original url is presumed to be more interesting..

    let me know if this helps your situation.

    thanks
    tim
     
    Tim_Mac, Mar 24, 2005
    #2
    1. Advertising

  3. =?Utf-8?B?SmluZ3hpIENoZW4=?=

    Brock Allen Guest

    Ian has discussed this:

    http://www.interact-sw.co.uk/iangblog/2004/01/12/shinyurl

    and http://www.interact-sw.co.uk/iangblog/2004/01/14/rewritingurls

    and there is a MSDN article:

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/urlrewriting.asp

    And these are all done in ASP.NET. The ISAPI is also not a bad idea, but
    it's probabaly going to be more complicated (code wise).

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen



    > I want mapping any url to a certain .dll to process. For example I
    > want all requests to URL http://myserver/vpath1 or
    > http://myserver/vpath1/anyfile be redirected to myhandler.dll to
    > handle. One important thing is that the URLs I want to redirect may
    > not physically exit, they could be just virtual URLs.
    >
    > Thanks!
    >
     
    Brock Allen, Mar 24, 2005
    #3
  4. =?Utf-8?B?SmluZ3hpIENoZW4=?=

    Tim_Mac Guest

    i agree with brock.
    but... if you want virtual folder urls, then ISAPI is the only way as
    far as i know.
     
    Tim_Mac, Mar 24, 2005
    #4
  5. Thanks a lot for your informative inputs and the project you shared with
    us, Tim_Mac,

    Hi cjx,

    I totally agree with Tim_Mac , if you want to intercept all kinds of coming
    request (url contains an document extension or only a directory url ....),
    the ISAPI filter is the only solution. ASP.NET's UrlRewriting can perfectly
    handle dynamic document(with a certain extension)'s request redirection but
    can not work for folder path.

    Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    Steven Cheng[MSFT], Mar 25, 2005
    #5
    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. Brian Tyler

    Dynamically mapping a URL

    Brian Tyler, Feb 14, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    320
    Brian Tyler
    Feb 14, 2004
  2. Jon paugh
    Replies:
    1
    Views:
    739
  3. Albretch
    Replies:
    2
    Views:
    940
    William Brogden
    Jul 11, 2003
  4. Fran Cotton

    Servlet URL Mapping Evil!

    Fran Cotton, Jul 25, 2003, in forum: Java
    Replies:
    0
    Views:
    3,367
    Fran Cotton
    Jul 25, 2003
  5. Just D.
    Replies:
    0
    Views:
    434
    Just D.
    Aug 11, 2004
Loading...

Share This Page