Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Umbraco 404 with different culture not working

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

like image 445
Giu Avatar asked Jun 15 '15 16:06

Giu


1 Answers

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.

like image 59
Mivaweb Avatar answered Nov 08 '22 16:11

Mivaweb