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.

results of URL trace

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:

  1. Why would Squarespace want to strip out certain utm_ query variables?

  2. Why would it strip those variables only during a non-www to www redirect?

  3. Is this a bug Squarespace should fix, or is there a reason for this behaviour?

  • How are these redirects implemented? Is this code that you put in a .htaccess file or is this a "add www" checkbox feature of squarespace? – Stephen Ostermiller Mar 19 at 9:56
  • The first redirect happens from my server's .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. – Sam Nabi Mar 20 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.