Forum Topic: Redirecting URLs that start with &mc
Any idea how to redirect any incoming URLs that start with
to my home page.
http://mysitedomainurlhere.com/&mc_cid=b4c0302253&mc_eid=i88a0a40ca http://mysitedomainurlhere.com/&mc_cid=b4c0302253&mc_eid=d88dfvacae http://mysitedomainurlhere.com/&mc_cid=b4c0302253&mc_eid=dfyucd
redirect 301 ^/&mc_cid=b4c0302253&mc_eid http://mysitedomainurlhere.com
But no luck…
5 Replies to “Redirecting URLs that start with &mc”
Just had another crack at this with:
RedirectMatch 301 ^&mc_cid=b4c0302253&mc_eid.* http://mysitedomainurlhere.com
But still no luck… :(
Aha, just guessed at this one:
RedirectMatch 301 /&mc_cid.* http://mysitedomainurlhere.com
…seems to be working…
Does this look right?
If it works, it works, but one thing that looks kinda odd is the format of the URL:
Normally parameters such as mc_cid are included in URLs via query string, which would look like this:
Such that a question mark is used to distinguish the first parameter, and then any additional parameters are added via ampersand (or even better encoded ampersand)..
So in this case, I just wonder if the URLs are written as intended.. as far as I know scripts only recognize query string parameters when passed via question mark.
Just my thoughts on it :)
Sadly those (varying) incoming URL formats are entirely out of my control.
Given that, is my solution the one you’d use (I’m such a beginner at this) or can you suggest a better alternative?
Really pleased to be able to use this forum by the way – really nice of you to have made it accessible to folk like me! ;)
It depends on whether or not your site also is using the same parameters. If not, then something like this would be keen:
RedirectMatch 301 (?i)&mc_cid http://mysitedomainurlhere.com
That will redirect any request containing
&mc_cid to the homepage. Let me know if that works, or if more refinement is needed, glad to help!