Copied to clipboard

Flag this post as spam?

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


  • Nicholas Westby 2005 posts 6843 karma points c-trib
    May 10, 2016 @ 00:26
    Nicholas Westby
    0

    Option to Ignore Query Strings and Option to Ignore Case in Regex?

    I just migrated my vanity redirects from a custom tool to 301 URL Tracker and noticed that they don't quite function the same, which broke some functionality. Here's the situation...

    If I make a request to site.com/youtube?id=123, I get some markup back that is used by an overlay to play a YouTube video. However, if I make a request to site.com/youtube, that's supposed to redirect to a YouTube channel on youtube.com. That was working before when I had my custom vanity solution setup.

    However, once I migrated over to 301 URL Tracker, it was then forwarding the site.com/youtube?id=123 URL to the YouTube channel. Here's what I have configured:

    Redirect

    I have already confirmed that I can get around this by doing a regex, which seems to incorporate the query string (i.e., I can use "$" to match end of string and ensure no query string is present). However, when I'm doing bulk migrations like this (in this case, there were 303 redirects to migrate), I'd like to avoid regular expressions, as I imagine they are slower (they must each be processed per URL rather than using a hash map/dictionary).

    Another problem I found with the regular expressions are that they appear to be case sensitive, and there is no option to make them case insensitive. That leads to funky regular expressions like this:

    ^[Yy][Oo][Uu][Tt][Uu][Bb][Ee]$
    

    It would be ideal to not have to do that.

    I guess that leaves me with two feature requests (or clarifications if these features already exist):

    • An option to match the URL exactly (i.e., don't redirect if there is a query string).
    • An option to ignore case in regular expressions.
  • Nicholas Westby 2005 posts 6843 karma points c-trib
    May 13, 2016 @ 18:24
    Nicholas Westby
    0

    Just got bit again by a similar issue. In this case, we migrated a redirect that was "/some-folder/some-page" to 301 URL Tracker. In this case, 301 URL Tracker seems to automatically also redirect the page with a trailing slash, so "/some-folder/some-page/" was also redirecting.

    This caused a problem because we don't want the page with the forward slash to redirect. Would be nice if there were some option like "Match old URL verbatim" (i.e., so the URL won't redirect if there is a trailing slash or if there is a query string).

    I'd really like to have this fixed. Would you be open to a pull request?

  • 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