Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Max Mumford 266 posts 293 karma points
    Jan 04, 2011 @ 12:48
    Max Mumford
    0

    Custom 404 page working for all bug .aspx file types

    Hi all,

    Our custom 404 pages were working for .aspx files using Umbraco's 404 function and for non-aspx files using IIS's 404 function before upgrading from 3.2 to 4.5. Now, only non-aspx 404 errors are working. When I try and navigate to a non-existant .aspx file I get the following error:

    Here is how I have the 404 errors set up:

    umbracoSettings.config page:

    404 error page node:

    As you can see, I have told Umbraco where to look, and the page specified does exist. 

    Can somebody tell me where I am going wrong? Or is it a deeper error...?

    Thanks,

    Max.

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Jan 04, 2011 @ 15:52
    Sebastiaan Janssen
    0

    I think you need to change this key in your web.config:

    <httpErrors existingResponse="PassThrough" />

    It will pass all of the 404 errors through to Umbraco instead of letting IIS handle them.

  • Max Mumford 266 posts 293 karma points
    Jan 07, 2011 @ 14:05
    Max Mumford
    0

    thanks for the reply. I put it in the web.config file as a child of <system.webServer>. The .aspx files are acting the same and all other 404 errors now show google chrome's...

    Oops! This link appears to be broken.

     

    ... message

    Very odd!

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Jan 10, 2011 @ 08:23
    Sebastiaan Janssen
    0

    That is indeed really weird, could you try it in IE or Firefox to see what the actual error message is?

  • Max Mumford 266 posts 293 karma points
    Jan 10, 2011 @ 11:38
    Max Mumford
    0

    IE says 404: the web page cannot be found

    The webpage cannot be found

     HTTP 404

     

    firefox says "Done" and shows a blank white pace

     

    Very odd...

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Jan 10, 2011 @ 15:02
    Sebastiaan Janssen
    0

    Hmm, do you have this set to "On"?

    <customErrors mode="On" />

    What does your 404handlers.config say?

  • Max Mumford 266 posts 293 karma points
    Jan 10, 2011 @ 15:29
    Max Mumford
    0

    Same 404 error with cutom errors set to on. 

    404handlers.config:

    <?xml version="1.0" encoding="utf-8"?>

    <NotFoundHandlers>

      <notFound assembly="umbraco" type="SearchForAlias" />

      <notFound assembly="umbraco" type="SearchForTemplate" />

      <notFound assembly="umbraco" type="SearchForProfile" />

      <notFound assembly="Umbraco.PoetPatcher" type="GenericError" />

    </NotFoundHandlers>

    Not sure if the above is correct - afaik poet patcher was a patch for an asp security flaw that has since been patched by microsoft so it could be removed...

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Jan 10, 2011 @ 16:30
    Sebastiaan Janssen
    0

    Oh you really don't need the PoetPatcher any more unless your server has not been patched for months.

    Replace the last entry:

    <notFound assembly="Umbraco.PoetPatcher" type="GenericError" />

    with:

    <notFound assembly="umbraco" type="handle404"/>
  • Max Mumford 266 posts 293 karma points
    Jan 10, 2011 @ 17:19
    Max Mumford
    0

    Hmm, making that change now corrects the .aspx 404 error page but the non .aspx pages still return a 404. Where can I check the page ID for this?

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Jan 10, 2011 @ 17:30
    Sebastiaan Janssen
    3

    Ah yes, I have it backwards, try this:

    <httpErrors errorMode="Custom">
           <remove statusCode="404" subStatusCode="-1" />
           <error statusCode="404" prefixLanguageFilePath="" path="/non-existing-page.aspx" responseMode="ExecuteURL" />
    </httpErrors>

    The non-existing-page.aspx does not exist yet in Umbraco, so it triggers a 404 (because it has the aspx extension) and.. presto: Umbraco handles the 404 perfectly!

     

     

  • Max Mumford 266 posts 293 karma points
    Jan 10, 2011 @ 17:38
    Max Mumford
    0

    Perfect :D Thanks for all your help, much appreciated.

    Max.

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Jan 10, 2011 @ 17:53
    Sebastiaan Janssen
    0

    No problem, could you mark my answer as the solution please?

  • Max Mumford 266 posts 293 karma points
    Jan 10, 2011 @ 18:03
    Max Mumford
    0

    Marked as solution :)

    I have implemented the above changes to our live website's files and am now getting a page saying:

    The page cannot be displayed because an internal server error has occurred.

    Any ideas why this might be happening?

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Jan 10, 2011 @ 18:08
    Sebastiaan Janssen
    0

    Not sure, what is the REAL error (check the umbracoLog table and the windows event log).

    Do you have IIS version 7 on your server as well?

  • Max Mumford 266 posts 293 karma points
    Jan 10, 2011 @ 18:13
    Max Mumford
    0

    Hmm, if I'm right in thinking that the only way to see the umbraco log without having access to the server is by getting a package for umbraco, I'm going to put this error on hold for a while; I still have some xslt issues and am in the middle of several other things and don't want to have a broken website on my hands incase anything goes wrong during the package install.

    I will probably get back onto this in the next few days.

    Thanks again for your help :)

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Jan 10, 2011 @ 18:16
    Sebastiaan Janssen
    0

    Ah, it sucks that you don't have access! Make sure to create a new topic when you get back to this, as you will probably not get many replies to a topic that's already "solved" and I'm not sure I can answer soon enough in a few days :-)

  • Max Mumford 266 posts 293 karma points
    Jan 10, 2011 @ 18:17
    Max Mumford
    0

    Erm... really unsure how... but I managed to fix it? All 404's now work since I have taken out all of the changes made to the web.config file but left the 404handlers file. I'm very confused, but I suppose I can't complain ^_^

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Jan 11, 2011 @ 08:16
    Sebastiaan Janssen
    1

    IIS works with a lot of config inheritance. My guess is that your webhost has already set up the custom error handling correctly for you in IIS, so you don't have to overrule it in the web.config. That wouldn't exactly explain the exception, but does explain why it works out of the box! :-)

Please Sign in or register to post replies

Write your reply to:

Draft