Copied to clipboard

Flag this post as spam?

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


  • Alexander Christiansson 4 posts 24 karma points
    Jun 25, 2012 @ 11:42
    Alexander Christiansson
    0

    Always default 404 page on multilangual site

    Hello,

    I'm working on a multilangual website running on Umbraco 4.7. Each of the languages runs under its own subfolder, which is working fine until I get a 404 error. For some reason it does not use the current culture's error page, but jumps straight to the default one.

    The hostnames for the folders are set to "domainSV" and "domainEN". I've tried setting them to domain.com/sv/ and domain.com/en/, but that does not seem to solve my problem.

    Most of the solutions I've seen so far involves changing the source code, which I'd prefer not to. Are there any way to solve this without making any big changes?

    umbracoSettings.config

    <errors>
      <error404>
        <errorPage culture="default">1242</errorPage>
        <errorPage culture="sv-SE">1242</errorPage>
        <errorPage culture="en-US">1240</errorPage>
      </error404>
    </errors>   

     

    Request trace

    aspx.page  Begin PreInit       
    umbracoInit handling request
    request handler current url '/en/aasdf/'
    umbracoRequestHandler   xpath: '/root/* [@urlName = "en"]/* [@urlName = "aasdf"]'
    umbracoRequestHandler   Just before xPath query (False, '/root/* [@urlName = "en"]/* [@urlName = "aasdf"]')
    umbracoRequestHandler   pageXPathQueryStart: '/root'
    notFoundHandler Trying NotFoundHandler 'umbraco.SearchForAlias'...
    urlAlias    'en/aasdf'
    notFoundHandler Trying NotFoundHandler 'umbraco.SearchForTemplate'...
    umbracoRequestHandler   xpath: '/root/* [@urlName = "en"]/* [@urlName = "aasdf"]'
    notFoundHandler Trying NotFoundHandler 'umbraco.SearchForProfile'...
    notFoundHandler Trying NotFoundHandler 'umbraco.handle404'...
    notFoundHandler NotFoundHandler 'umbraco.handle404 found node matching en/aasdf/ with id: 1224
    umbracoRequestHandler   After xPath query
    umbracoRequestHandler   Access checking started
    umbracoRequestHandler   Page not protected
    umbracoRequestHandler   Access checking ended
    umbracoInit Done handling request
    umbracoPage testing altTemplate
    umbracoPage Element loaded: titleText
    umbracoPage Element loaded: umbracoNaviHide
    umbracoPage Element loaded: bodyText
    umbracoPage Pagedata loaded for Not found (ID: 1224)
    umbracoPage Looking up skin information
    default.aspx    Culture changed to sv-SE

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jun 25, 2012 @ 18:54
    Jan Skovgaard
    0

    Hi Alexander

    What happens if you simply uncomment the default culture?

    /Jan

  • Alexander Christiansson 4 posts 24 karma points
    Jun 26, 2012 @ 09:05
    Alexander Christiansson
    0

    Tried commenting out the default culture which made the error page turn into the default Umbraco one. It's as if Umbraco doesn't recognize the culture at all.

  • Alexander Christiansson 4 posts 24 karma points
    Jun 28, 2012 @ 16:13
    Alexander Christiansson
    0

    Shameless bump.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jun 28, 2012 @ 21:39
    Jan Skovgaard
    0

    Hi Alexander

    Ok, seems like Umbraco is not being allowed to handle the 404 requests.

    Try adding this to your web.config file:

    <httpErrorserrorMode="Custom">
           
    <removestatusCode="404"subStatusCode="-1"/>
           
    <errorstatusCode="404"prefixLanguageFilePath=""path="/non-existing-page.aspx"responseMode="ExecuteURL"/>
    </httpErrors>

    This should make Umbraco handle the non-existing .aspx pages.

    You can read Sebastiaans explanation here for further details: http://stackoverflow.com/questions/4471683/setting-errorpage-in-umbraco/4471924#4471924

    Hope this helps.

    /Jan

     

  • Yiannis Vavouranakis 36 posts 76 karma points
    Apr 22, 2013 @ 09:37
    Yiannis Vavouranakis
    0

    Hello all.

    Sorry for hijacking this thread, but I have the exact same situation in an Umbraco v6 installation.

    In particular, I have the following in web.config under system.webserver:

       <httpErrors errorMode="Custom">
            <remove statusCode="404" subStatusCode="-1" />
            <remove statusCode="500" subStatusCode="-1" />
            <error statusCode="404" prefixLanguageFilePath="" path="/non-existing-page.aspx" responseMode="ExecuteURL" />
            <error statusCode="500" prefixLanguageFilePath="" path="/500.html" responseMode="ExecuteURL" />
        </httpErrors>
    
    the following under system.web:
    <customErrors mode="On" defaultRedirect="500.html">
        <error statusCode="500" redirect="500.html"/>
        <error statusCode="404" redirect="not-existing-page.aspx"/>
    </customErrors>
    the following in UmbracoSettings.config 
    <errors>
        <error404>
            <errorPage culture="default">1303</errorPage>
            <errorPage culture="el-GR">1303</errorPage>
            <errorPage culture="en-US">1304</errorPage>
        </error404>
    </errors>
    
    And I always get the ENGLISH version of the 404 page, never the Greek.
    Am I missing something here?
  • Alexander Christiansson 4 posts 24 karma points
    Jun 27, 2013 @ 10:16
    Alexander Christiansson
    0

    If anyone else is having the same problem, i solved it (a year later) using a solution from stackoverflow.

    http://stackoverflow.com/questions/6929304/add-custom-404-pages-in-umbraco-4-7?rq=1

  • Yiannis Vavouranakis 36 posts 76 karma points
    Jun 27, 2013 @ 11:57
    Yiannis Vavouranakis
    0

    Unfortunately, no.

    When I tried to apply the solution from SO, I got a 500 error:

    System.ApplicationException: The current httpContext can only be set once during a request.
       at Umbraco.Web.UmbracoContext.set_Current(UmbracoContext value)
       at Umbraco.Web.UmbracoContext.EnsureContext(HttpContextBase httpContext, ApplicationContext applicationContext, Boolean replaceContext)
       at Umbraco.Web.UmbracoModule.BeginRequest(HttpContextBase httpContext)
       at Umbraco.Web.UmbracoModule.<Init>b__6(Object sender, EventArgs e)
    at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

    I'm really baffled by this...

  • Yiannis Vavouranakis 36 posts 76 karma points
    Jun 27, 2013 @ 12:01
    Yiannis Vavouranakis
    0

    Actually, sorry for the previous post. The error was something else. However, I'm still getting the same page (english). So, the solution didn't break the site, but didn't fix the issue either.

Please Sign in or register to post replies

Write your reply to:

Draft