Copied to clipboard

Flag this post as spam?

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


  • Medjeti 75 posts 126 karma points
    Mar 10, 2014 @ 13:28
    Medjeti
    0

    Manual redirects no longer working

    Hi guys,

    I'm experiencing a strange issue with the URL Tracker: Manually entered redirects seem to have stopped working and now just show my custom 404. Renamed and moved nodes still redirect as expected.

    The issue seems slightly related to this one, except I don't have any query string parameters:

    http://our.umbraco.org/projects/developer-tools/301-url-tracker/version-2/44041-Redirects-no-longer-work-when-created-%28older-ones-still-do%29

    Any idea where I can start debugging this? Is there a log I can have a look at?

    URL Tracker v 2.5.3
    Umbraco v 4.11.8

    Any and all suggestions welcome - thanks in advance!

  • Medjeti 75 posts 126 karma points
    Mar 10, 2014 @ 13:35
    Medjeti
    0

    By the way, my install is an upgrade from the old 301 Url Tracker.

    The upgrade seemed to go smoothly and I'm fairly certain manually entered urls have been working since the upgrade.

  • Medjeti 75 posts 126 karma points
    Mar 14, 2014 @ 11:48
    Medjeti
    0

    Anyone?

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Mar 18, 2014 @ 08:39
    Stefan Kip
    0

    Please enable logging (it's mentioned in the Info screen) and take a look at what the logs are telling.

  • Medjeti 75 posts 126 karma points
    Mar 18, 2014 @ 10:13
    Medjeti
    0

    Cheers, I'll give it a go.

  • Medjeti 75 posts 126 karma points
    Mar 27, 2014 @ 19:35
    Medjeti
    0

    Right, so I managed to find out how to enable logging.
    If anybody else is wondering: Add the key "urlTracker:enableLogging" with a value of "true" to the appSettings section of the web.config and set umbracoDebugMode=true. The UrlTracker will now log events to the umbracoLog table in the DB.

    So, I set up a manual redirect for the url mysite.com/test123/ (the trailing slash seems to be added automatically).

    When I request the url with a trailing slash, the site returns my custom 404 page and the following 11 lines are written to the log:

    id userId  NodeId  Datestamp   logHeader   logComment
    13453751 0 -1 2014-03-27 19:11:46.750 Debug UrlTracker HttpModule | PostReleaseRequestState end
    13453750 0 -1 2014-03-27 19:11:46.750 Debug UrlTracker HttpModule | No match found, logging as 404 not found
    13453749 0 -1 2014-03-27 19:11:46.703 Debug UrlTracker HttpModule | Current request's rootNodeId: 1074
    13453748 0 -1 2014-03-27 19:11:46.703 Debug UrlTracker HttpModule | Response statusCode is 404, continue URL matching
    13453747 0 -1 2014-03-27 19:11:46.703 Debug UrlTracker HttpModule | PostReleaseRequestState start
    13453746 0 -1 2014-03-27 19:11:46.703 Debug UrlTracker HttpModule | Incoming URL is: test123/
    13453745 0 -1 2014-03-27 19:11:46.233 Debug UrlTracker HttpModule | PostReleaseRequestState end
    13453744 0 -1 2014-03-27 19:11:46.220 Debug UrlTracker HttpModule | Current request's rootNodeId: 1074
    13453743 0 -1 2014-03-27 19:11:46.220 Debug UrlTracker HttpModule | Response statusCode is 404, continue URL matching
    13453742 0 -1 2014-03-27 19:11:46.220 Debug UrlTracker HttpModule | Incoming URL is: test123/
    13453741 0 -1 2014-03-27 19:11:46.220 Debug UrlTracker HttpModule | PostReleaseRequestState start

    So, apparantly it sees two incoming requests, and no match is found, which is odd in itself. This happens very consistently - always these 11 lines in the log.

    However, if I make the same request without the trailing slash, about 300 lines are logged - including requests to css, images and other resources. For these resources the log says "Response statuscode is not 404, UrlTracker won't do anything".

    I'm not sure if this has anything to do with the redirect failing to match the incoming url, but it does seem strange.

    Any suggestions on what I can do to get to the bottom of this?

    Thanks in advance!

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Mar 27, 2014 @ 22:24
    Stefan Kip
    0

    Those 11 lines are not two requests, but one; once for the AcquireRequestState event and once for the EndRequest event.
    The log you posted looks like a legit log if no match is found, the question is why no match is found.

    Could you post here what the entry for the redirect in the DB (icUrlTracker table) looks like?

    Ps. I've changed the 'PostReleaseRequestState start' and 'PostReleaseRequestState end' logging in the source to match the events mentioned above, so that will be fixed in a future version.

  • Medjeti 75 posts 126 karma points
    Mar 28, 2014 @ 10:39
    Medjeti
    0

    Hey Kip,

    Thanks for your swift reply. That explains the 11 lines, then.

    The icUrltracker table has 23 entries for the oldUrl 'test123'. One looks like this:

    Id    OldUrl    OldUrlQueryString    OldRegex    RedirectRootNodeId    RedirectNodeId    RedirectUrl    RedirectHttpCode    RedirectPassThroughQueryString    Notes    Is404    Referrer    Inserted    ForceRedirect
    10120    test123    NULL    NULL    24827    1075    NULL    301    1    NULL    0    NULL    2014-03-10 13:12:12.570    0

    - and the other 22 are identical like this:

    Id    OldUrl    OldUrlQueryString    OldRegex    RedirectRootNodeId    RedirectNodeId    RedirectUrl    RedirectHttpCode    RedirectPassThroughQueryString    Notes    Is404    Referrer    Inserted    ForceRedirect
    10121    test123    NULL    NULL    1074    NULL    NULL    301    1    NULL    1    NULL    2014-03-10 13:12:18.973    0

    1074 is the root node of my site. 1075 is the node I'm trying to redirect to, and a direct child of 1074.

    Strangely, 24827 is a copy of the root node that is has been deleted and is now in the Recycle Bin. 1075 is not a descendant of this node.

    So, two things worth noting: 1) Multiple - both identical and possibly conflicting - entries for the same oldUrl, and 2) Some sort of mixup regarding the nodeids - pointing to a deleted node, and nodeId / rootNodeId that are not in the same path.

    I'm not really sure how these things are connected, but if you have any suggestions for me to try I'm all ears.

    Thanks!
    /Mikael

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Mar 28, 2014 @ 10:44
    Stefan Kip
    0

    How about removing the entry with the 24827 rootnodeid and cleaning up the other 22 duplicates, so you'll end up with one entry. And change the RedirectNodeId of that entry from NULL to the nodeid you'd like? Does it work after these steps?

  • Medjeti 75 posts 126 karma points
    Mar 28, 2014 @ 11:19
    Medjeti
    100

    Alright, now we're getting somewhere!

    I cleaned up the entries so there was just the one with the correct RedirectNodeId, but I still just got a 404.

    I then deleted the entry and created a new one using the admin interface. Once again this came up with the RedirectRootNodeId of the deleted copy of the root node.

    I then deleted the node from the recycle bin and tried to make a new entry. This entry now has the correct RedirectRootNodeId and redirects as expected.
    Furthermore, this seems to somehow have fixed up the other redirects that weren't working!

    I'll have a closer look later today and see if this is consistent. Will report back.

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Mar 28, 2014 @ 11:23
    Stefan Kip
    0

    The wrong RedirectRootNodeId could be caused by hostnames set on the recycled node?

    Anyway, good to hear the issue has been solved for you!

  • Medjeti 75 posts 126 karma points
    Mar 28, 2014 @ 13:45
    Medjeti
    0

    Well hot damn!

    I had a look in the DB of my production site which had the same problem - and sure enough, the addresses that weren't redirecting were referencing the delted root node.
    I replaced the invalid nodeid with the id of the actual root node, and that fixed me right up.

    I'm not sure what actually caused the problem - it might have been a hostname issue as you suggested - but at least everything is on the up & up now.

    Thanks for helping out - have a great weekend!

  • 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