Forum Topic: Redirecting URLs that start with &mc

Forum: .htaccess Forum : Redirecting • Posted by Brin Wilson • Updated:

Hi all,

Any idea how to redirect any incoming URLs that start with


to my home page.

For example:


I’ve tried:

redirect 301 ^/&mc_cid=b4c0302253&mc_eid

But no luck…


5 Replies to “Redirecting URLs that start with &mc”

Posted by Brin Wilson

Just had another crack at this with:

RedirectMatch 301 ^&mc_cid=b4c0302253&mc_eid.*

But still no luck… :(


Posted by Brin Wilson

Aha, just guessed at this one:

RedirectMatch 301 /&mc_cid.*

…seems to be working…

Does this look right?

Jeff? :)

Posted by Jeff Starr

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 :)

Posted by Brin Wilson

Thanks Jeff,

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! ;)


Posted by Jeff Starr

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

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!