Umbraco 404 with different culture not working
Asked Answered
P

2

6

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

Protomartyr answered 15/6, 2015 at 16:37 Comment(6)
can you try to unpublish the EN node structure and test the FR redirect to the FR 404 page?Jahdai
I did it. I am not redirected to the fr 404 page.Protomartyr
To the default 404 page or to which page are you redirected now?Jahdai
Sorry for the lack of details, I am redirected to the default 404 page aka 'Page not found No umbraco document matches the url '/fr/dsaddsadsdas'. This page can be replaced with a custom 404. Check the documentation for "custom 404". This page is intentionally left ugly ;-) 'Protomartyr
Did you set culture info on EN and FR node? (right click on FR node and set it)Adhamh
Yes I did, both my root documents (EN-FR) have their culture set (en-US for the 1st one, fr-FR for the second). This is why I can use dictionary based on the culture in documentsProtomartyr
J
1

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.

Jahdai answered 29/6, 2015 at 7:42 Comment(0)
G
0

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"/>
Geomorphology answered 9/1, 2017 at 7:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.