I've been trying to setup multiple error pages for a multilingual website we're developing, and I've run into problems (and searching the forum, it seems to be a very common problem).
Setup
I'm in an Umbraco v6.1.6 - here's a condensed version of the Content tree:
[Content]
Global
Denmark (da-DK)
Germany (de-DE)
England (en-GB)
Denmark, Germany and England are root/site nodes so they have their own culture and hostname defined (using the domain.com/dk pattern) - each of them has a childnode named “404" which should be served as the localized error page.
What I was able to do
I could set the simple version of an error page in umbracoSettings.config, i.e.: <error404>1234</error404> and have that page be served whenever there was an error.
This is described in the documentation
What I wanted to do
But as it is, my website is available in three languages and I'd very much like to have a localized version of that error page. So I tried the "culture-aware" version of the above (where the <error404> key has an <errorPage> for each defined culture), but the only thing I could get reliably working, resulted in getting the error page from the first site. That, or I'd get Umbraco's default "intentionally left ugly :-)" page.
I tried the uComponents MultiSiteNotFoundHandler which is otherwise very simple to setup - have a property named umbracoPageNotFound on the root of every site and point that (via ID) to the site’s own error page. But I couldn't even get that to work, so I'm out of good ideas at the moment.
(For the record, I've also set the <httpErrors existingResponse="PassThrough" /> key that the documentation page mentions)
From previous posts I kinda get the feeling that people tend to write their own handlers for this, but that’s not an option for me - I'm really interested in getting to the bottom of why this doesn't work. And if it's just a stupid error by me, I'd like to be able to not do that again next time :)
I really don’t want to have to write a frickin' handler for something that's supposed to work :-) It's Umbraco - it just works in so many other ways!
@Chriztian - sounds like the bug with <errorPage> still exists. It should work in the umbracoSettings.config file as noted in the file itself. Bug report here, please vote it up http://issues.umbraco.org/issue/U4-2508
Perhaps its being broken for so long is why people have started writing their own handlers even for simple situations? In any case, it should be fixed to behave as advertised and as it has worked since at least v3.
There is something that I've found that I need to enable for most of my Umbraco sites - a hidden away flag in umbracoSettings.config. The trySkipIisCustomErrors option is set to false by default, flip it to a true:
So I did a little "rubber ducking" to assure myself that I wasn't going crazy.
A little more info:
The root nodes have an umbracoUrlName property so that the "Denmark" node is accessed as /dk/, "Germany" as /de/ etc.
Now, when I'd assigned the 404 pages' IDs in umbracoSettings.config, the Germany node wasn't even accessible at /de/, even though its "Link to document" was citing that as its URL? It even gave me the danish 404 page - not even the default one... (what the...??)
I tried to check the Hostname settings, but when I tried to set its hostname, Umbraco told me that the hostname was already defined - which of course it was - but it was defined on a node that had been trashed.
When I deleted (really deleted!) that node from the Recycle bin, things started working!
So I'm guessing that there's a problem between the thingymajiggy stuff that looks up rootnodes by hostnames and the fact that a "hostnamed" node is still visible even when it's been trashed, which ultimately results in the wrong rootnode being returned and thus, the GetCurrentNotFoundPageId() function doesn't find a specific error page?
@Chriztian - you mean you got it working with the umbracoSettings.config file all by itself after you deleted the trashed node?
I can't get my test site (v7.1.8) to use the culture enabled 404 pages using the umbracoSettings.config items alone. It's a very simple site with two root nodes (each assigned a culture but no hostname; I'm using the <umbracoHideTopLevelNodeFromPath>false</umbracoHideTopLevelNodeFromPath> setting).
[CONTENT]
EN
Products
News
Not Found
DE
Das Products
Das News
Das Not Found
If you've gotten this to work I'd love to know how.
So I just checked the umbracoHideTopLevelNodeFromPath - it's true in my site (but it's in the form of <add key="umbracoHideTopLevelNodeFromPath" value="true" />).
And I have hostnames defined using the domain.com/en and domain.com/de pattern, even though I also have umbracoUrlName set to those ("en" and "de").
And then I've obviously put the 404 pages' IDs in the config...
/Chriztian
(BTW: Love how you germanized those pages with "Das" :-)
With Chriztian's help a reliable workaround has been found until the bug can be fixed...
Always include the domain when using 'Culture and Hostnames' if you want to also use the culture-specific not found entries in the umbracosettings.config file, such as:
@Ayo - the trySkipIisCustomErrors option is there to ignore IIS from handling custom error pages. Enabling it would mean that you'd like the web-app (e.g. Umbraco) to handle a custom error (404, 500), rather than the web-server (IIS) itself.
I raised an issue on the tracker about changing the default value to true, but it would be a breaking change - so maybe in v8? http://issues.umbraco.org/issue/U4-4997
I know it's old, but... dealing with the "issue" now. A few things:
Yes, a hostname on a node in the recycle bin still is a hostname and cannot be assigned until it has been cleared. This is because ppl expect they can move a node to the recycle bin, and then back, and it has not changed (still has its domain).
In latest 7.4, it will tell you that you cannot assign the domain because it is already assigned to another node and will tell you which node has it assigned already.
TrySkipIisCustomErrors is required to prevent IIS from taking over the error and displaying its own message. It tells IIS that even though the response code is 404, it should not alter the content of the response.
I just run some tests, including with nodes in the bin, and all seems to work correctly. So... can we clarify the situation / identify what the bug is exactly with repro. instructions?
One last thing to note is that in order to pick the proper 404 page, there needs to be a proper culture. In the example, site.com/dk/missing would pick the DK 404 page whereas site.com/de/missing would pick the DE 404 page. Because we have been able to match the domains (site.com/dk and site.com/de).
However, site.com/missing would pick the "default" 404 page because we cannot match a domain, and therefore still have the default culture.
Setting up error pages in a multilingual site
I've been trying to setup multiple error pages for a multilingual website we're developing, and I've run into problems (and searching the forum, it seems to be a very common problem).
Setup
I'm in an Umbraco v6.1.6 - here's a condensed version of the Content tree:
Denmark, Germany and England are root/site nodes so they have their own culture and hostname defined (using the domain.com/dk pattern) - each of them has a childnode named “404" which should be served as the localized error page.
What I was able to do
I could set the simple version of an error page in umbracoSettings.config, i.e.:
<error404>1234</error404>
and have that page be served whenever there was an error. This is described in the documentationWhat I wanted to do
But as it is, my website is available in three languages and I'd very much like to have a localized version of that error page. So I tried the "culture-aware" version of the above (where the
<error404>
key has an<errorPage>
for each defined culture), but the only thing I could get reliably working, resulted in getting the error page from the first site. That, or I'd get Umbraco's default "intentionally left ugly :-)" page.I tried the uComponents MultiSiteNotFoundHandler which is otherwise very simple to setup - have a property named
umbracoPageNotFound
on the root of every site and point that (via ID) to the site’s own error page. But I couldn't even get that to work, so I'm out of good ideas at the moment.(For the record, I've also set the
<httpErrors existingResponse="PassThrough" />
key that the documentation page mentions)From previous posts I kinda get the feeling that people tend to write their own handlers for this, but that’s not an option for me - I'm really interested in getting to the bottom of why this doesn't work. And if it's just a stupid error by me, I'd like to be able to not do that again next time :)
I really don’t want to have to write a frickin' handler for something that's supposed to work :-) It's Umbraco - it just works in so many other ways!
/Chriztian
@Chriztian - sounds like the bug with
<errorPage>
still exists. It should work in the umbracoSettings.config file as noted in the file itself. Bug report here, please vote it up http://issues.umbraco.org/issue/U4-2508Perhaps its being broken for so long is why people have started writing their own handlers even for simple situations? In any case, it should be fixed to behave as advertised and as it has worked since at least v3.
cheers,
doug.
Hi Chriztian,
There is something that I've found that I need to enable for most of my Umbraco sites - a hidden away flag in
umbracoSettings.config
. ThetrySkipIisCustomErrors
option is set tofalse
by default, flip it to atrue
:I hope this helps? :-)
Cheers,
- Lee
@Lee - FWIW, that setting made no difference on my sample 7.1.8 site.
cheers,
doug.
Thanks guys!
So I did a little "rubber ducking" to assure myself that I wasn't going crazy.
A little more info:
The root nodes have an umbracoUrlName property so that the "Denmark" node is accessed as /dk/, "Germany" as /de/ etc.
Now, when I'd assigned the 404 pages' IDs in umbracoSettings.config, the Germany node wasn't even accessible at /de/, even though its "Link to document" was citing that as its URL? It even gave me the danish 404 page - not even the default one... (what the...??)
I tried to check the Hostname settings, but when I tried to set its hostname, Umbraco told me that the hostname was already defined - which of course it was - but it was defined on a node that had been trashed.
When I deleted (really deleted!) that node from the Recycle bin, things started working!
So I'm guessing that there's a problem between the thingymajiggy stuff that looks up rootnodes by hostnames and the fact that a "hostnamed" node is still visible even when it's been trashed, which ultimately results in the wrong rootnode being returned and thus, the
GetCurrentNotFoundPageId()
function doesn't find a specific error page?Hope this makes sense to the right people :-)
/Chriztian
@Chriztian - you mean you got it working with the umbracoSettings.config file all by itself after you deleted the trashed node?
I can't get my test site (v7.1.8) to use the culture enabled 404 pages using the umbracoSettings.config items alone. It's a very simple site with two root nodes (each assigned a culture but no hostname; I'm using the
<umbracoHideTopLevelNodeFromPath>false</umbracoHideTopLevelNodeFromPath>
setting).If you've gotten this to work I'd love to know how.
cheers,
doug.
Hi Douglas,
Yes - it's working; it's actually working :-)
So I just checked the
umbracoHideTopLevelNodeFromPath
- it'strue
in my site (but it's in the form of<add key="umbracoHideTopLevelNodeFromPath" value="true" />
).And I have hostnames defined using the domain.com/en and domain.com/de pattern, even though I also have
umbracoUrlName
set to those ("en" and "de").And then I've obviously put the 404 pages' IDs in the config...
/Chriztian
(BTW: Love how you germanized those pages with "Das" :-)
With Chriztian's help a reliable workaround has been found until the bug can be fixed...
Always include the domain when using 'Culture and Hostnames' if you want to also use the culture-specific not found entries in the umbracosettings.config file, such as:
This also explains why the uComponents MultiSitePageNotFoundHandler didn't work either - it uses the same function to do the domain lookup.
Thanks, Chriztian for the help!
cheers,
doug.
Bravo chaps! This thread IS Umbraco :)
I had a similar problem, I was just getting a blank white page, and not getting my 404.
I just tried Lee Kelleher's soultion..
started working straight away can anyone explain what "trySkipIisCustomErrors" actually is?
@Ayo - the
trySkipIisCustomErrors
option is there to ignore IIS from handling custom error pages. Enabling it would mean that you'd like the web-app (e.g. Umbraco) to handle a custom error (404, 500), rather than the web-server (IIS) itself.I raised an issue on the tracker about changing the default value to
true
, but it would be a breaking change - so maybe in v8?http://issues.umbraco.org/issue/U4-4997
I know it's old, but... dealing with the "issue" now. A few things:
I just run some tests, including with nodes in the bin, and all seems to work correctly. So... can we clarify the situation / identify what the bug is exactly with repro. instructions?
One last thing to note is that in order to pick the proper 404 page, there needs to be a proper culture. In the example, site.com/dk/missing would pick the DK 404 page whereas site.com/de/missing would pick the DE 404 page. Because we have been able to match the domains (site.com/dk and site.com/de).
However, site.com/missing would pick the "default" 404 page because we cannot match a domain, and therefore still have the default culture.
is working on a reply...