locked
Rewrite Path not working properly RRS feed

  • Question

  • User-1672250969 posted

    Hi everyone,

                    I've been having a hell of day trying to get Context.RewritePath() working.  It was all going really well until I try to change a url that doesn't specify the aspx file i.e /localhost/House and Home/.  If I do this then I get the following error:

     

    Description: The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

    Error Code: 0x80070002

    Notification: MapRequestHandler

    Module: IIS Web Core

    Requested URL: http://localhost/FAQ.aspx?

    Physical Path: C:\inetpub\wwwroot\House and Home

    Logon User: Anonymous

    Logon Method: Anonymous

    Handler: StaticFile

     

    The strange thing is though if I do it specify the file name i.e /localhost/House and Home/default.aspx then it works.  However I'm already on google with the first file name so can't simply change all urls to specify the full path.  Anyone have any ideas? many thanks, Anthony

    Saturday, October 6, 2007 1:52 PM

Answers

  • User-2060689755 posted

    Hi fitz29,

    You should add "default.aspx" as "default content page".

    Default content page include:

    1. Default.htm
    2. Default.asp
    3. index.htm
    4. iisstart.htm

    So you add default.aspx as default page , it will works.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 10, 2007 3:29 AM

All replies

  • User-1853252149 posted

    Spaces in the URL may get replaced with %20, becoming a new URL.

    Jeff

    Saturday, October 6, 2007 2:03 PM
  • User-1672250969 posted

    No this is not the issue at all.  As I said it's to do with whether default.aspx is specified at the end.  If I put a dummy default file in the location of the url it works.  I've read somewhere that it might be to do with how IIS 7 deals with unspecified default files and that they just put lots of dummy files everywhere, however this would mean hundreds of dummy files in my root directory, so any other solutions are very welcome.

    Saturday, October 6, 2007 2:13 PM
  • User-2060689755 posted

    Hi fitz29,

    You should add "default.aspx" as "default content page".

    Default content page include:

    1. Default.htm
    2. Default.asp
    3. index.htm
    4. iisstart.htm

    So you add default.aspx as default page , it will works.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 10, 2007 3:29 AM