normally we just use the <error404> in umbracoSettings.config to point to a fixed nodeId for a custom error page. However currently we're needing different custom error pages for different languages. The <errorPage> entries don't seem to be quite as cooperative and the only one that works is the "default" one. Others cultures get ignored?
We've also tried adding the <error404> tags around these (as suggested in some other posts), but that doesn't change anything.
In Umbraco we have two sites (SiteSections), each with their own language sections. To every language section we have a culture defined through manage hostnames. If I check for the availability of the culture, all is good and dictionary items also work a charm.
In web.config there are no custom error handlers defined that might overrule the umbracoSettings.config.
I wrote my own 404 handler where I react on the language and position in the tree and return true if I found a node which handles the specific node/language. Definitions on what to chosse are stored in an xml config file.
A NotFoundHandler, like Thomas's one, is the way I'd go about doing it. But I've been using a version from a code snippet I found in an old Umbraco book:
that's exactly what we have, yes. Even though we've got the hostname set up to Dutch (Netherlands), it keeps going to whatever pageId we enter in the 'default' entry. Very curious.
Thomas: thanks for your insights and code. Might have to look into implementing something similar in future projects.
404 handling on multilingual site
Hi guys,
normally we just use the <error404> in umbracoSettings.config to point to a fixed nodeId for a custom error page. However currently we're needing different custom error pages for different languages. The <errorPage> entries don't seem to be quite as cooperative and the only one that works is the "default" one. Others cultures get ignored?
Our setup:
<errorPage culture="default">1</errorPage>
<errorPage culture="nl-NL">1245</errorPage>
We've also tried adding the <error404> tags around these (as suggested in some other posts), but that doesn't change anything.
In Umbraco we have two sites (SiteSections), each with their own language sections. To every language section we have a culture defined through manage hostnames. If I check for the availability of the culture, all is good and dictionary items also work a charm.
In web.config there are no custom error handlers defined that might overrule the umbracoSettings.config.
Any ideas?
*bump, I'd be curious to know the answer for this one too.
I wrote my own 404 handler where I react on the language and position in the tree and return true if I found a node which handles the specific node/language. Definitions on what to chosse are stored in an xml config file.
@Thomas, care to share those mad skills? any source we can sneek a look at anywhere?
Here is a simple peace of code which demonstrates the usage. You can also react on the Browser language settings or all other HTTP headers:
Snippet
hth, Thomas
Hi Bjorn,
The structure of the error pages should be like this...
Just checking, is that what you had?
A NotFoundHandler, like Thomas's one, is the way I'd go about doing it. But I've been using a version from a code snippet I found in an old Umbraco book:
http://umbraco.org/documentation/books/not-found-handlers/creating-a-custom-not-found-handler
It lets you control the 404 page within Umbraco, via a content picker data-type.
Good luck, Lee.
Hi Lee,
that's exactly what we have, yes. Even though we've got the hostname set up to Dutch (Netherlands), it keeps going to whatever pageId we enter in the 'default' entry. Very curious.
Thomas: thanks for your insights and code. Might have to look into implementing something similar in future projects.
Bjorn, any solution as to why it is just going to the default entry?
Seth,
we've had no luck getting this to work as it should out of the box. Ultimately resulted to some custom programming as suggested above.
Sorry I have no better news for you.
is working on a reply...