Removing certain query string parameters only

Comments

1 comment

  • lukebussey

    There's a better way of doing this now:

    import querystring;
    
    /* remove client-side tracking parameters from querystring */
    if (req.url ~ "\?") {
        set req.url = querystring.clean(req.url);
        set req.url = querystring.regfilter(req.url, "utm_[a-z]+|mkt_tok|gclid");
        set req.url = querystring.sort(req.url);
    }
    

Please sign in to leave a comment.