Copied to clipboard

Flag this post as spam?

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


  • Stefan 117 posts 215 karma points
    Mar 10, 2014 @ 12:37
    Stefan
    0

    Redirects not working properly on multilingual site

    Unfortuatenely URL Tracker is not working quite as expected for my multilingual site. When for example renaming a node in the content editor, the "Old URL" is set properly. On the other hand, whenever an 404 error occurs on the site the "Old URL" is just set to the query (and not the hostname), for example:

    http://www.mysite.com/test

    redirects to:

    http/test/

    If I try to add the 404 as a permanent redirect, the "Old URL" just stays the same.

    Below are entries for urlRewriting.config:

            <add name="301RedirectDirUrls"
                redirectMode="Permanent"
                redirect="Application"
                ignoreCase="true" 
                rewriteUrlParameter="IncludeQueryStringForRewrite"
                virtualUrl="^\/(?!(umbraco\/|data\/|install\/|usercontrols\/|umbraco_client\/))(.*)\.aspx"
                destinationUrl="$1/$2" />
            <!-- Canonical URL rewrite for all domains without www -->
            <add name="ForceWWW" 
                   virtualUrl="http\://(?!www\.)(?!images\.)" 
                   redirectMode="Permanent" 
                   destinationUrl="http://www." 
                   ignoreCase="true" 
                   redirect="Domain" />

    I'm not so confident in those rewrites, and wonders if some information are lost in the process?

    From web.config

        <!--<httpErrors existingResponse="PassThrough"/>-->
        <httpErrors existingResponse="Replace" errorMode="Custom">
          <remove statusCode="404" subStatusCode="-1" />
          <error statusCode="404" prefixLanguageFilePath="" path="/error/404.aspx?" responseMode="ExecuteURL" />
          <remove statusCode="500" subStatusCode="-1" />
          <error statusCode="500" prefixLanguageFilePath="" path="/error/404.aspx?" responseMode="ExecuteURL" />
        </httpErrors>
        <!--<modules runAllManagedModulesForAllRequests="true">-->

    And the following from 404handlers.config

    <?xml version="1.0" encoding="utf-8" ?>
    <NotFoundHandlers>
      <notFound assembly="umbraco" type="SearchForAlias" />
      <notFound assembly="umbraco" type="SearchForTemplate"/>
      <notFound assembly="umbraco" type="SearchForProfile"/>
      <notFound assembly="umbraco" type="handle404"/>
    </NotFoundHandlers>

    Please let me know if you need any other information :)

    Best regards
    Stefan

  • Stefan 117 posts 215 karma points
    Mar 10, 2014 @ 22:16
    Stefan
    0

    I have been investigating the issue a bit further, and have not found a solution. However, I have noticed that whenever a 404 error is found, it is not added as the correct site on which it occured. No matter which site (.dk, .com or .de) it is always registered as if it occured on the .dk site. And yes, each site has an associated hostname set.

    It seems to me as the hostname is not registered, causing Url Tracker to register the "Old URL" as "http/a-page-not-found/".

    Below are some entries from the tracelog with logging enabled for Url Tracker (some information has been omitted):

    Type: Debug | User: 0 | NodeId: -1 | Comment: UrlTracker HttpModule | Incoming URL is: urltrackertest/
    Type: Debug | User: 0 | NodeId: -1 | Comment: UrlTracker HttpModule | PostReleaseRequestState start
    Type: Debug | User: 0 | NodeId: -1 | Comment: UrlTracker HttpModule | Current request's rootNodeId: 1161
    Type: Debug | User: 0 | NodeId: -1 | Comment: UrlTracker HttpModule | PostReleaseRequestState end
    Type: Debug | User: 0 | NodeId: -1 | Comment: UrlTracker HttpModule | PostReleaseRequestState start
    Type: Debug | User: 0 | NodeId: -1 | Comment: UrlTracker HttpModule | Incoming URL is: urltrackertest/
    Type: Debug | User: 0 | NodeId: -1 | Comment: UrlTracker HttpModule | Response statusCode is 404, continue URL matching
    Type: Debug | User: 0 | NodeId: -1 | Comment: UrlTracker HttpModule | Current request's rootNodeId: 1161
    Type: Debug | User: 0 | NodeId: -1 | Comment: UrlTracker HttpModule | No match found, logging as 404 not found
    Type: Debug | User: 0 | NodeId: -1 | Comment: UrlTracker HttpModule | PostReleaseRequestState end
    Type: Debug | User: 0 | NodeId: -1 | Comment: UrlTracker HttpModule | PostReleaseRequestState start
    Type: Debug | User: 0 | NodeId: -1 | Comment: UrlTracker HttpModule | Incoming URL is: urltrackertest/
    Type: Debug | User: 0 | NodeId: -1 | Comment: UrlTracker HttpModule | Response statusCode is 404, continue URL matching
    Type: Debug | User: 0 | NodeId: -1 | Comment: UrlTracker HttpModule | Current request's rootNodeId: 1161
    Type: Debug | User: 0 | NodeId: -1 | Comment: UrlTracker HttpModule | PostReleaseRequestState end
    Type: Debug | User: 0 | NodeId: -1 | Comment: UrlTracker HttpModule | PostReleaseRequestState start
    Type: Debug | User: 0 | NodeId: -1 | Comment: UrlTracker HttpModule | Incoming URL is: urltrackertest/
    Type: Debug | User: 0 | NodeId: -1 | Comment: UrlTracker HttpModule | Response statusCode is 404, continue URL matching
    Type: Debug | User: 0 | NodeId: -1 | Comment: UrlTracker HttpModule | Current request's rootNodeId: 1161
    Type: Debug | User: 0 | NodeId: -1 | Comment: UrlTracker HttpModule | No match found, logging as 404 not found
    Type: Debug | User: 0 | NodeId: -1 | Comment: UrlTracker HttpModule | PostReleaseRequestState end
    Type: Debug | User: 0 | NodeId: -1 | Comment: UrlTracker HttpModule | PostReleaseRequestState start

     

  • Stefan 117 posts 215 karma points
    Mar 10, 2014 @ 22:44
    Stefan
    0

    When entering the "Old URL" manually, the redirect is working properly, but only for my .dk domain. For the other sites, the redirects are not working at all.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies