however her activity the past day or so has been little
Well, it's not MY fault I slept all day
:: whine ::
Agreeing with everyone else: Yes, you need to get rid of that RedirectMatch business and translate everything to mod_rewrite syntax (RewriteRule). Redirects using mod_alias are fine if #1 you don't use mod_rewrite at all (this seems unlikely, since only mod_rewrite can do a domain-name-canonicalization redirect, which everyone should have), and #2 you never need to look at query strings, which only mod_rewrite can do, and #3 if you don't require the [NE] flag which may-- again,
may-- be needed here.
NE means "no escape", i.e. send all special characters back to the requestor in their original form, without percent-encoding. For example, if you're redirecting to an in-page fragment link with # you have to use [NE] so the the # doesn't get changed to %23. (This is the example used in the Apache docs, and also happens to be the only situation where I've used the flag, but there are others.)
From your first post:
RedirectMatch 301 ^/$ http://example.com/?utm_source=site_1\&utm_medium=redirect\&utm_term=/$1\&utm_campaign=merger_2016
The form \& isn't needed. I assume your object is to escape literal ampersands-- but nothing in the target needs to be escaped anyway. (If escaping
were necessary, you would also need to escape the ? mark.)
:: detour to rarely visited mod_alias docs to ensure I'm not talking through my hat ::
The $1 means "use something you captured from the pattern", except there was no capture-- in fact there was nothing
to capture, since the rule is written to apply only to requests for the root. This makes me suspect that the rule was cut-and-pasted from some other source, and we need to figure out what you're really trying to do. Is the object to store information about the originally requested URL, whatever it was? If so, this specific rule can simply omit the "$1" since its content will be null anyway.
Whether in RedirectMatch or RewriteRule, there's never a reason to capture-and-reuse if the content of the capture will always be the same. Just write out whatever the literal text is.
utm_term=%2Fone%2Ftwo%2Fthree%2F
Where does this come from? The rule is obviously plugging
something into that "$1" but what? Does the original request have "/one/two/three/" and you're now looking at the result of some other redirect from a different rule applying to a different original URL? This is confusing.
Do you really need all those separate utm_ elements in the query string? Is it built into GA? Otherwise I'd think you could compress everything into a single term, like "tracker=2016_$1" where $1 is the originally requested URL. And then only if, in fact, something
was captured. Otherwise just "tracker=2016_/"
Incidentally, you could replace
^/$
with
^/(index\.htm|$)
to kill two birds with one stone. (Note position of $ closing anchor.) And the same thing with any request for a directory, mutatis mutandis. Omit the leading / in mod_rewrite unless the rule is lying loose in the config file, which I don't think is the case.