Excluding Querystrings from being rewritten

Overview

DNN's friendly URL rewriting feature turns all query strings into part of the base URL. By default, this includes things like tracking links. For example:

 

Original URL Converted URL
example.com?gclid=testuser1234 example.com/home/glcid/testuser1234

 

This may skew analytics data as this will be interpreted as a different page for Analytics services. You can use the Keep in Querystring Regular Expression regex string to prevent URL rewriting from changing tracking query strings without modifying your existing URLs.

 

Solution

  1. Go to Settings > SEO > Url Management > Expressions

    2020-09-22_11_57_37-My_Website___Home.png

  2. Append the specific query string to the Keep in Querystring Regular Expression text box.
    For example:

    /nomo/\d+|/runningDefault/[^/]+|/popup/(?:true|false)|/(?:page|category|sort|tags)/[^/]+|tou/[^/]+|(/utm[^/]+/[^/]+)+|/gclid/|/fbclid/
  3. Click Save.

 

Testing

You can test that the query strings are not being rewritten by AUM by accessing the URL with the query strings. If a user visits the site with a tracking link (e.g. mysite.com/sales?glid=randomstring), DNN should not rewrite this URL to mysite.com/sales/glid/randomstring.

Comments

0 comments

Article is closed for comments.