• We just changed the structure of about 300 URLs on our site. I used Redirection to do the 301s and it works from a plain URL standpoint. However, I used Hubspot to post all the prior URLs on social, etc. and those no longer work because instead of this: www/page/post, the URLs generated from Hubspot include cookie code that makes the URL look like this: www/page/post/?utm_campaign=Content%20Marketing&utm_content=20849744&utm_medium=social&utm_source=twitter

    Is there any sort of wildcard function I can use to make the old Hubspot URLs work? I’ve talked to Hubspot, but they don’t have any answers. Anything anyone can offer would be greatly appreciated.

    https://www.ads-software.com/plugins/redirection/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Maybe a regex expression like this would work?

    source:
    /page/post/(.*$)

    target
    /newpage/newpost/$1

    This should grab everything after “post/” and paste it on to the end of the newpost/

    Thread Starter Vince Abbate

    (@vince-abbate)

    Thanks, wings.

    I tried it but it, but it didn’t work. It’s definitely a problem that’s beginning to irk me. I really appreciate your help, though.

    Are you saying you _do_ want to carry the UTM_ parameters over to your target URL?

    I’m needing the same info. We’ve got some inbound Google Analtyics tracking links that I would like to redirect to another domain, but keep the tracking code at the end of the URL intact. Thanks for any help!

    Just found the answer! https://moz.com/learn/seo/redirection

    Redirecting the GET String

    Some of the PHP scripts had different names but the GET string stayed the same. The Moz developers needed to redirect the visitors to the new PHP scripts while preserving these GET strings. The GET string is the set of characters that come after a filename in the URL and are used to pass data to a web page. An example of a GET string in the URL /myfile.php?this=that&foo=bar would be “?this=that&foo=bar.”

    Redirect: https://www.socengine.com/seo/categorydetail.php?CAT_ID=12345
    To: https://www.seomoz.org/artcat.php?CAT_ID=12345

    Solution:
    Add the following directive:

    RedirectMatch 301 /seo/categorydetail.php(.*) https://www.seomoz.org/artcat.php$1

    Explanation:
    Once again the regular expression (.*) tells apache to match zero or more of any character and save it as the back-reference $1. Since there is a $1 after /seo/categorydetail.php, it will now redirect the get string to this new PHP file.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Redirecting Hubspot Cookie Code In URL’ is closed to new replies.