Short URLs are great for marketing purposes, especially when they are destined for print. Users will find typing the following URL laborious, and will likely not even bother to do it.
Short URLs are great for marketing purposes, especially when they are destined for print.
Instead, we create a short URL like the following one.
We then redirect this one to the longer one. Helpful. Common. Nothing groundbreaking here.
However, there's a common gotcha. These short URLs are also often used in digital advertising, and these platforms append query strings for tracking purposes.
For example, an email marketing platform might append the following query strings.
If we're not careful with our redirects at a server level, these query strings might get stripped out. This could muddle your analytics. Also, depending on your configuration, the redirect might entirely 404.
To avoid this, I like to use the following IIS rule in the
This is referencing an external file called
rewritemap.config, where all the key/value pairs live. I will explain how to set this up in a future blog post.