Copied to clipboard

Flag this post as spam?

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


  • Edward 21 posts 113 karma points
    Jan 14, 2017 @ 04:32
    Edward
    0

    Cannot make 404 page work on Umbraco Cloud

    Hello everyone,

    I am facing problem, that I cannot set custom 404 page on live site (on umbraco cloud).

    On local machine everything works fine.

    Page Id specified in umbracoSettings.config

    Web config contains:

    <httpErrors existingResponse="PassThrough" />
    

    Document type and node were created on local machine and deployed afterwards.

    Any help would be very valuable! Thank you!

    Page not found
    
    No umbraco document matches the url '/test'.
    
  • Dennis Adolfi 1082 posts 6449 karma points MVP 6x c-trib
    Jan 14, 2017 @ 08:17
    Dennis Adolfi
    102

    Hi Edward.

    Have you specified the id as an int? Because node ids tends to differ between environments in Cloud you should specify the guid instead in the umbracoSettings for the 404 page.

    Have you tried that?

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Jan 14, 2017 @ 09:28
    Sebastiaan Janssen
    3

    Dennis' suggestion is really good, make sure to set it to the GUID of the page (or an XPath query if you happen to have a multilingual site).

    My other suggestion is that existingResponse="PassThrough" does nothing more than the default value (Auto), in fact it does LESS - any URLs that end in .html for example will just give a blank response. So leave it to Auto or just remove the existingResponse attribute because Auto is the default if it's not there.
    Source of this info: http://stackoverflow.com/a/31041696/5018

    The other tip that I have is that you will still see a default message (The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.) if people land on a .txt or .html URL if you leave it set to Auto. This is because those file extensions don't usually go through the whole ASP.NET pipeline. To force any 404 to be handled by Umbraco though, you can redirect the URL to a URL that would normally get picked up by Umbraco like so:

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

    So this says: if you encounter a 404, just try to go to the URL /non-existing-page/ instead. The ASP.NET and Umbraco pipeline then kicks in and the custom 404 page set in your umbracoSettings.config file will be presented.

  • Edward 21 posts 113 karma points
    Jan 14, 2017 @ 10:24
    Edward
    1

    Thank you guys for help!

    It was late night...... , and you were right about id.. they were different, so used GUID.

  • Dennis Adolfi 1082 posts 6449 karma points MVP 6x c-trib
    Jan 14, 2017 @ 11:23
    Dennis Adolfi
    0

    Awesome Edward! Glad to be able to help! Have a great day!

Please Sign in or register to post replies

Write your reply to:

Draft