Custom 404 is not kicking in - 500 internal server error
Hi all,
I have following the 'Configuring 404 pages in Umbraco' wiki to the letter on our hosting environment and yet I am still experiencing issues with our custom 404 page not being displayed.
You are presented with the servers 500 Internal Server Error.
The server error returned is delivered by IIS 7.5 so I have followed the additional configuration required for this but still no joy.
I believe the problem is that the server is treating this as a physical path as in the error page it says it is looking for the following:
httpdocs\test\web.config
Surely the web.config at the root of my site, in the httpdocs folder, should be taking care of this.
I have spoken to our hosting provider and they have told me that because the server is running a Plesk interface, it cannot be setup in this way and that I would have to set up static custom 404 pages in HTML for this to work but I do not believe that.
Does anyone have any ideas of how to solve this issue as the people I have spoken to at our hosting provider Storm internet do not seem to have a clue.
It seems that only doesn't work on this one url. Maybe create a content node with name "test" and a view. In the view you can insert a 301 permanent redirect to your custom 404 error page.
My umbracoSettings.config file can be found below:
<?xml version="1.0" encoding="utf-8" ?>
<settings>
<!--
umbracoSettings.config configuration documentation can be found here:
http://our.umbraco.org/documentation/using-umbraco/config-files/umbracoSettings/
Many of the optional settings are not explicitly listed here
but can be found in the online documentation.
-->
<content>
<errors>
<error404>1188</error404>
</errors>
<notifications>
<!-- the email that should be used as from mail when umbraco sends a notification -->
<email>[email protected]</email>
</notifications>
<!-- Show property descriptions in editing view "icon|text|none" -->
<PropertyContextHelpOption>text</PropertyContextHelpOption>
<!-- The html injected into a (x)html page if Umbraco is running in preview mode -->
<PreviewBadge><![CDATA[<a id="umbracoPreviewBadge" style="position: absolute; top: 0; right: 0; border: 0; width: 149px; height: 149px; background: url('{1}/preview/previewModeBadge.png') no-repeat;" href="{0}/endPreview.aspx?redir={2}"><span style="display:none;">In Preview Mode - click to end</span></a>]]></PreviewBadge>
<!-- Cache cycle of Media and Member data fetched from the umbraco.library methods -->
<!-- In seconds. 0 will disable cache -->
<UmbracoLibraryCacheDuration>1800</UmbracoLibraryCacheDuration>
<!-- How Umbraco should handle errors during macro execution. Can be one of the following values:
- inline - show an inline error within the macro but allow the page to continue rendering. Historial Umbraco behaviour.
- silent - Silently suppress the error and do not render the offending macro.
- throw - Throw an exception which can be caught by the global error handler defined in Application_OnError. If no such
error handler is defined then you'll see the Yellow Screen Of Death (YSOD) error page.
Note the error can also be handled by the umbraco.macro.Error event, where you can log/alarm with your own code and change the behaviour per event. -->
<MacroErrors>inline</MacroErrors>
<!-- These file types will not be allowed to be uploaded via the upload control for media and content -->
<disallowedUploadFiles>ashx,aspx,ascx,config,cshtml,vbhtml,asmx,air,axd</disallowedUploadFiles>
<!-- Defines the default document type property used when adding properties in the back-office (if missing or empty, defaults to Textstring -->
<defaultDocumentTypeProperty>Textstring</defaultDocumentTypeProperty>
</content>
<security>
<!-- set to true to auto update login interval (and there by disabling the lock screen -->
<keepUserLoggedIn>false</keepUserLoggedIn>
<!-- change in 4.8: Disabled users are now showed dimmed and last in the tree. If you prefer not to display them set this to true -->
<hideDisabledUsersInBackoffice>false</hideDisabledUsersInBackoffice>
</security>
<requestHandler>
<!-- this will ensure that urls are unique when running with multiple root nodes -->
<useDomainPrefixes>false</useDomainPrefixes>
<!-- this will add a trailing slash (/) to urls when in directory url mode -->
<addTrailingSlash>true</addTrailingSlash>
</requestHandler>
<templates>
<!-- To switch the default rendering engine to MVC, change this value from WebForms to Mvc -->
<defaultRenderingEngine>Mvc</defaultRenderingEngine>
</templates>
<scheduledTasks>
<!-- add tasks that should be called with an interval (seconds) -->
<!-- <task log="true" alias="test60" interval="60" url="http://localhost/umbraco/test.aspx"/>-->
</scheduledTasks>
<!-- distributed calls must be enabled when using Umbraco in a load balanced environment -->
<distributedCall enable="false">
<!-- the id of the user who's making the calls -->
<!-- needed for security, umbraco will automatically look up correct login and passwords -->
<user>0</user>
<!--
When distributed call is enabled, you need to add all of the servers part taking in load balancing
to the server list below.
-->
<servers>
<!--
Add ip number or hostname, make sure that it can be reached from all servers
you can also add optional attributes to force a protocol or port number.
Examples:
<server>127.0.0.1</server>
<server forceProtocol="http|https" forcePortnumber="80|443">127.0.0.1</server>
Generally when setting up load balancing you will designate a 'master' server,
Umbraco will always assume that the FIRST server listed in this list is the 'master'.
(NOTE: Not all load balancing scenarios have a 'master', depends on how you are setting it up)
In order for scheduled tasks (including scheduled publishing) to work properly when load balancing, each
server in the load balanced environment needs to know if it is the 'master'. In order for servers
to know this or not, they need to compare some values against the servers listed. These values
are either: serverName or appId. You should not enter both values but appId will always supersede serverName.
The serverName is the easiest and will work so long as you are not load balancing your site on the same server.
If you are doing this, then you will need to use appId which is equivalent to the value returned from
HttpRuntime.AppDomainAppId. It is recommended that you set either the serverName or appId for all servers
registered here if possible, not just the first one.
Examples:
<server serverName="MyServer">server1.mysite.com</server>
<server appId="/LM/W3SVC/69/ROOT">server1.mysite.com</server>
-->
</servers>
</distributedCall>
<!--
web.routing
@trySkipIisCustomErrors
Tries to skip IIS custom errors.
Starting with IIS 7.5, this must be set to true for Umbraco 404 pages to show. Else, IIS will take
over and render its build-in error page. See MS doc for HttpResponseBase.TrySkipIisCustomErrors.
The default value is false, for backward compatibility reasons, which means that IIS _will_ take
over, and _prevent_ Umbraco 404 pages to show.
@internalRedirectPreservesTemplate
By default as soon as we're not displaying the initial document, we reset the template set by the
finder or by the alt. template. Set this option to true to preserve the template set by the finder
or by the alt. template, in case of an internal redirect.
(false by default, and in fact should remain false unless you know what you're doing)
-->
<web.routing
trySkipIisCustomErrors="true"
internalRedirectPreservesTemplate="false">
</web.routing>
</settings>
I specifically ensured that the trySkipIisCustomErrors option was marked to true.
Custom 404 is not kicking in - 500 internal server error
Hi all,
I have following the 'Configuring 404 pages in Umbraco' wiki to the letter on our hosting environment and yet I am still experiencing issues with our custom 404 page not being displayed.
https://our.umbraco.org/wiki/install-and-setup/configuring-404-pages
Our domain is
http://www.axumtech.com
As you will see, this works fine and any pages you navigate to via the menu navigation also work correctly.
However, if you navigate to a page that does not exist such as:
http://www.axumtech.com/test
You are presented with the servers 500 Internal Server Error.
The server error returned is delivered by IIS 7.5 so I have followed the additional configuration required for this but still no joy.
I believe the problem is that the server is treating this as a physical path as in the error page it says it is looking for the following:
httpdocs\test\web.config
Surely the web.config at the root of my site, in the httpdocs folder, should be taking care of this.
I have spoken to our hosting provider and they have told me that because the server is running a Plesk interface, it cannot be setup in this way and that I would have to set up static custom 404 pages in HTML for this to work but I do not believe that.
Does anyone have any ideas of how to solve this issue as the people I have spoken to at our hosting provider Storm internet do not seem to have a clue.
Hi Jason
Would you mind sharing your configuration? It would be nice to see it.
Don't know if the issue can perhaps be related to the settings in /config/umbracoSettings.config -
<web.routing>
section?/Jan
Hi Jason,
it works on this url:
http://www.axumtech.com/dsfsdfsd
But on http://www.axumtech.com/test I get also an 500 Internal Server Error.
It seems that only doesn't work on this one url. Maybe create a content node with name "test" and a view. In the view you can insert a 301 permanent redirect to your custom 404 error page.
I hope this can help you?
Best,
Sören
Hi Jan,
My umbracoSettings.config file can be found below:
I specifically ensured that the trySkipIisCustomErrors option was marked to true.
Kind regards,
Jason Espin
@Soren
The problem is this rule should be kicking in for all urls and not just a few here and a few there hence why there is something wrong.
is working on a reply...