RewritePath - Folder To a Query (How To?)

Discussion in 'ASP .Net' started by Tomasz J, Nov 4, 2007.

  1. Tomasz J

    Tomasz J Guest

    Hello Developers,

    I am trying to write a code inside BeginRequest event handler which would
    rewrite the following path:
    /myapp/user123
    to:
    /myapp/?user=user123
    Is it doable? No matter what I try I keep getting "resource not found".

    Can it be accomplished with HttpContext.RewritePath? May be I should use
    some other method instead?

    Thank you for any pointers.

    Tomasz J
     
    Tomasz J, Nov 4, 2007
    #1
    1. Advertisements

  2. This is an important requirement because?
    Possibly, but you've already implied that whatever the default document is
    it should be script.
    IIS will not be inserting the various document names into the string for you
    in this case.
    Only be manually determining what the file name should be, ugly.
    Yes assume default.aspx or some other fixed name.
     
    Anthony Jones, Nov 4, 2007
    #2
    1. Advertisements

  3. Thanks for Anthony's input.

    Hi Tomasz,

    For ASP.NET runtime, it can not handle those requests that hasn't a
    document extension(all the requestes should end with a document extension).
    That's why you always get "resouce not found error". If you do need to
    intercept all the requests(include the folder path requests), you may
    consider using raw IIS ISAPI filter.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    This posting is provided "AS IS" with no warranties, and confers no rights.
    --------------------
     
    Steven Cheng[MSFT], Nov 5, 2007
    #3
  4. Tomasz J

    Tomasz J Guest

    I understand. After all it is for IIS to request the default page, not
    ASP.Net

    That leaves me with Response.Redirect(), but I just hate to impose this
    additional round-trip.

    Thank you.

    Tomasz J
     
    Tomasz J, Nov 5, 2007
    #4
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.