Copied to clipboard

Flag this post as spam?

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


  • andrew darby 11 posts 122 karma points
    Mar 21, 2017 @ 18:25
    andrew darby
    0

    404 errors on some pages using https

    I am testing our new site on https, and find that certain pages occasionally show as 404 not found. It only happens for some pages, and sometimes I get the correct page and sometimes I get the 404 page. If I disable https the pages all work again, but we want production to be using https.

    Enabling Failed request logging in IIS I get the following:

    AspNetPipeLineEnter
    Umbraco.Web.UmbracoModule
    
    URL CHANGED
    OldUrl /search?query=rome
    NewUrl /umbraco/RenderMvc?query=rome
    
    
    URL CHANGED
    OldUrl /umbraco/RenderMvc?query=rome
    NewUrl /search?query=rome
    

    MODULESETRESPONSEERRORSTATUS

    ModuleName: UmbracoModule 
    Notification: 8 
    HttpStatus: 404 
    HttpReason: Not Found 
    HttpSubStatus: 0 
    ErrorCode: 0 
    ConfigExceptionInfo
    Notification: RESOLVE_REQUEST_CACHE
    ErrorCode: The operation completed successfully. (0x0)
    

    any idea on how to investigate this issue further, or suggestions on possible cause, as I am a bit stuck

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Mar 22, 2017 @ 07:30
    Michaël Vanbrabandt
    0

    Hi andrew,

    Can you confirm the following steps for enabling https for your production website:

    1. Enable https in the web.config by changing the key umbracoUseSSL to true

    2. Make sure you setup your IIS url rewrite rules so that everything points to the https version

          <rule name="Redirects to www.domain.com" patternSyntax="ECMAScript" stopProcessing="true">
                  <match url=".*" />
                  <conditions logicalGrouping="MatchAny" trackAllCaptures="false">
                      <add input="{HTTP_HOST}" pattern="^domain.be$" />
                  </conditions>
                  <action type="Redirect" url="https://www.domain.be/{R:0}" />
              </rule>
              <rule name="Http to Https" stopProcessing="true">
                  <match url="(.*)" />
                  <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                      <add input="{HTTPS}" pattern="^OFF$" />
                  </conditions>
                  <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" />
              </rule>
      
    3. Check your website content where you have urls defined so that they point to the https version of the url

    Hope this helps!

    If you have any questions, let me know!

    /Michaël

  • andrew darby 11 posts 122 karma points
    Mar 24, 2017 @ 09:56
    andrew darby
    0

    Thanks for the reply

    1. I did not set umbracoUseSSL to true, as I understand this is for backoffice and not required for the public website, but I will test if it makes a difference.
    2. Yes I have IIS rewrite rules to ensure all requests go to https
    3. Generally all urls within the site are setup as relative urls, so no direct links to http content.

    My main problem was that the site is working in https, but for certain pages including the search results page and the checkout page, I would sometimes get served the correct page and other times be served a 404. switching to http seems to solve the issue, but I need to investigate further why I was getting the 404 message.

    How Can I debug or diagnose the cause the a 404 page in umbraco, when the URL should be valid.

  • andrew darby 11 posts 122 karma points
    Apr 24, 2017 @ 13:31
    andrew darby
    101

    Just to close this question. The problem was to do with a custom URLProvider, we implemented to handle multilingual 1-1 website, inspired by Jeroen Breuer post and example on github http://24days.in/umbraco-cms/2015/multilingual-vorto-nested-content/

    We were expliciting saving the url scheme (http or https) in the GetUrl response, based on the first request to the site being (http or https)

    The 404 errors occur for https requests if the first request to the site was http, then our URL map was all http links, and future https requests will fail to match any url. Some https urls did appear to work at the time, but that was due to persistent page caching. likewise if the first request to the site was https, future http requests would fail.

    removing the scheme from the url in our IURLProvider and IContentFinder code solved the problem.

Please Sign in or register to post replies

Write your reply to:

Draft