Copied to clipboard

Flag this post as spam?

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


  • Roger 19 posts 57 karma points
    Oct 10, 2017 @ 11:45
    Roger
    0

    Regex Does Not Work (UrlTracker.3.13.1 / Umbraco 7)

    Hi all,

    This is a fantastic package - very useful to be able to give content editors ability to add and edit redirects in Umbraco. Today I discovered a feature that doesn't work (using the latest Umbracos)

    Investigation tells me it's possible this feature may have worked in the past, it could even be internal changes to Umbraco itself over the last year which may have stopped this working. It may also be possible, with some configuration tweaks or changes to Umbraco itself, to get the working.

    As noted by another user in a separate thread also regarding Regex not working as expected https://our.umbraco.org/projects/developer-tools/301-url-tracker/version-2/48188-Regex-Redirects

    But it's easy to reproduce by simply setting up the latest Umbraco and installing the latest Url Tracker (3.13.1)

    Consider the following Regex expressions:

    Regex: ^/blog-articles/(.*) Destination: /blog/$1

    (I would expect this to redirect /blog-articles/my-first-article to /blog/my-first-article )

    N.B. I also tried this with and without escaping the slashes: Regex: ^/blog-articles/(.*)

    Typically in most regex implementations, both will usually work, even though slashes are recommended to be escaped.

    When I realised something was not right I set a new regex rule to be:

    Regex: /fred/* and Regex: ^/fred/*

    (Bascially any url that contains /fred (and anything after) or any urls that start with fred (with anything, OR nothing following), and since neither of these simplest cases fire, I know that no regex will ever match in this system.

    It's not a problem for now as I can easily use the UrlRewriting.config file - but it would be ace if this feature could be revived!

  • Daniel Chenery 119 posts 464 karma points
    Oct 16, 2017 @ 09:12
    Daniel Chenery
    0

    I've created a GitHub issue for this :) https://github.com/kipusoep/UrlTracker/issues/173

    I think the caret (^) may actually be throwing it off here, I'm pretty sure it takes the domain into account from memory. I'd have to double check though...

    Have you tried without?

Please Sign in or register to post replies

Write your reply to:

Draft