Umbraco 404 with different culture not working

1.3k views Asked by At

My issue is actually close to this one: Umbraco V6 404 not handled properly according to culture

I have 2 directories with different culture:

Content
       EN
          page1
          page2
          404
       FR
          page1
          404

When I go from a FR page to a 404, the culture is back in english.

It looks like it's url-based, and probably with a 404 the engine can't find a link so it sets the culture as default but I would like to maintain this culture when the user meets a 404 page.

my config:

    <error404>
        <errorPage culture="en-US">1187</errorPage>
        <errorPage culture="fr-FR">1189</errorPage>
    </error404>

How can I do that ?

I use one-level path in domains.

Example of urls:

  • site/en/page1
  • site/en/page2
  • site/fr/page1

I use umbraco 7.2.5

2

There are 2 answers

0
Mivaweb On BEST ANSWER

After some reading on different forums I found that this is a common issue. But there is one post on the Umbraco Wiki that maybe can help you out.

This post contains information about writing your own 404 handler. Just create a new class that inherist from the umbraco.interfaces.INotFoundHandler interface which defines two properties and one method that needs to be included in your class.

0
Anders Smedman On

Old question but this works on Umbraco 7.x

umbracoSettings.config

<errors>
  <error404>
    <errorPage culture="default">1332</errorPage>
    <errorPage culture="en-US">1332</errorPage>
    <errorPage culture="sv-SE">1185</errorPage>
  </error404>
</errors>

web.config

Add below to <system.webServer>

<httpErrors existingResponse="PassThrough"/>