Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Leena 29 posts 100 karma points
    Apr 15, 2013 @ 12:31
    Leena
    0

    display error page as per culture

    Hi all,

    I am localizing my web site in three languages.I have managed host names for it. For handling Errors, I have added error page, I want to display that error page according to selected culture

    <system.web>
        <customErrors mode="On" defaultRedirect="~/Error.aspx">
                <error statusCode="404" redirect="~/Error404.aspx" />
        </customErrors>
    .....
    .....
    .....
    <system.web>

    I have added that in we.config

    Using umbraco version 6.0

     

  • Dave Woestenborghs 3235 posts 10979 karma points MVP 5x admin c-trib
    Apr 15, 2013 @ 13:03
  • Dennis Aaen 4448 posts 17912 karma points admin hq c-trib
    Apr 15, 2013 @ 13:05
    Dennis Aaen
    100

    Hi Leena,

    I think you should take a look in the file called umbracoSettings.config. The file is located in the folder called config.

    When you have found this one search in the file for  <errors> then you should find this section in the file

        <errors>
          <!-- the id of the page that should be shown if the page is not found -->
          <!--<error404>
                       <errorPage culture="default">1</errorPage>
                       <errorPage culture="en-US">200</errorPage>
                </error404>-->
          <error404>1</error404>
        </errors>

    I have taking the code from a clean installation of Umbraco 6.0.3, som my error page id is set to 1, but you have to switch the id of 1 out with the id of your error page and in your case you also should use the culture="".

    I hope the example above can help you further.

    /Dennis

  • Dave Woestenborghs 3235 posts 10979 karma points MVP 5x admin c-trib
    Apr 15, 2013 @ 13:09
    Dave Woestenborghs
    0

    You also need to set this in your web.config

    <httpErrors existingResponse="PassThrough"  />

  • Leena 29 posts 100 karma points
    Apr 16, 2013 @ 08:05
    Leena
    0

    Hi Dennis and Dave,

    Thanks for reply. Code is working and links are useful.

    but i would like to do little bit modification in code

     

    <errors>
          <!-- the id of the page that should be shown if the page is not found -->
          <error404 culture="default">1</error404>
          <error404 culture="en-US">2</error404>
          <error404 culture="de-DE">3</error404>
    </errors>

     

    - Leena

     

  • Leena 29 posts 100 karma points
    Apr 16, 2013 @ 08:57
    Leena
    0

    Hi Dennis and Dave,,

    By using above code I am able to display  localized 404ErrorPage as per selected language but I cant localized ErroPage 

    Eg : If u have any login functionality just try to enter Username as </html> Its giving error , I have handled that error page. I have login field and localization option on single page only. After choosing English language it is displaying error message in danish lang only.(Default language is danish language.)

    How to do that?

  • projectsVW 8 posts 78 karma points
    Jun 27, 2018 @ 13:53
    projectsVW
    0

    Are you got any solution for this problem?

  • Dan Diplo 1490 posts 5791 karma points MVP 4x c-trib
    Jun 27, 2018 @ 14:11
    Dan Diplo
    0

    I've written a blog post that explains (with code examples) how to create a custom IContentFinder to do this automatically:

    https://www.diplo.co.uk/blog/web-development/404-page-finder-for-multi-site-umbraco-installations/

Please Sign in or register to post replies

Write your reply to:

Draft