I'm setting up some redirects for a client's blog, pointing the old URLs to their new Squarespace site.
Curiously, I noticed some of URL tracking variables were being stripped out during the redirect.
This URL: https://olddomain.com/blog/blogpost-title?utm_medium=email&utm_source=campaign_monitor&utm_campaign=bridgit_newsletter&utm_content=sneakpeak_mar0719
Should have been redirected to: https://squarespacedomain.com/new-blogpost-slug?utm_medium=email&utm_source=campaign_monitor&utm_campaign=bridgit_newsletter&utm_content=sneakpeak_mar0719
But instead it was being redirected to: https://www.squarespacedomain.com/new-blogpost-slug?utm_content=sneakpeak_mar0719
Only some utm_
variables were being removed. If I included ?var_a=test&var_b=test
, they would make it through just fine.
The other unanticipated change is that, somewhere in the process, www.
got added to the URL.
Looking at the trace, there were actually two redirects happening.
Armed with this new information, I edited the redirect to point directly to the www.
version of the squarespace URL. When I did that, it stopped stripping out the utm_
variables.
So I have a few questions:
Why would Squarespace want to strip out certain
utm_
query variables?Why would it strip those variables only during a non-www to www redirect?
Is this a bug Squarespace should fix, or is there a reason for this behaviour?
.htaccess
file. The second redirect happens on Squarespace's server – there's no way to edit the .htaccess on Squarespace or disable their www redirects as far as I can tell. But as evidenced by the behaviour above, it's clear they're doing more than just redirecting to www.