Copied to clipboard

Flag this post as spam?

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


This forum does not allow new topics to be created, please use the v2 forum from now on.

  • andrew shearer 409 posts 517 karma points
    Sep 30, 2011 @ 01:49
    andrew shearer
    0

    Rule Match Bug

    we have a situation where two rules have similar oldurls:

    /website/path/Detail.aspx?id=88795

    /website/path/Detail.aspx?id=8879

    It looks the 301 package will match on the first rule above when the actual request url is the second one.

    In looking at the source code, is this line meant to have a wildcard match in the sql statement? why isn't it a direct match using the '=' operator?

    query = "SELECT NodeId, OldUrl FROM infocaster301 WHERE OldUrl LIKE @url + '%' AND IsRegex = 0";

     

     

  • Maxemilian Hilbrand 13 posts 37 karma points
    Nov 28, 2011 @ 17:12
    Maxemilian Hilbrand
    0

    Andrew

    the @url parameter just contains the page name without the parameters, thus the % is needed here to deliver any result which contains a query string.

    I have compiled the component with

    query = "SELECT NodeId, OldUrl FROM infocaster301 WHERE OldUrl LIKE @url + " +

    (querystring.HasKeys()?"'?' + '" + querystring + "'":"") + " AND IsRegex = 0";

    which delivers the exact URL.

    If you use it this way, you will have to configure all possible urls with the exact query string.

     

    Maxemilian

  • 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