RedirectMatch of Mod_Alias is not as powerful as Mod_Rewrite. If you have Mod_Rewrite on your host (Pretty Permalinks make use of it for example) you could make the redirect only if the URL is not in the Archive link format.
To test for that case, there is RewriteCond
and to make the redirect command, there is the RewriteRule ... [R=301]
directive.
An Example based on your data:
RewriteCond %{REQUEST_URI} !^/((20|19)[0-9]{2})/([0-9]{2})/[0-9]{2}$ [NC]
RewriteRule ^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)$ http://<domain>/$4 [R=301,L]
This is untested but I think it should do the work. I’ve used quantifier ({2}) to better specifiy how many numbers you expect. Next to that in the RewriteCond I’ve created a pattern that only matches the 20.. and 19.. years.
The first line (the condition, RewriteCond
) checks not to match an Archive-URL and only if not matched, the rule to do the redirect will be executed. The RewriteRule
is basically doing the same as your RedirectMatch
directive.