Rémon’s suggestion is a good one - for fixed content. However, with 12345678 being dynamic, leave it off the end of the “from” and “to” code as mod_alias will redirect the directories and leave the “file” request alone.
I believe that’s the reason that your RewriteMatch isn’t working - although it should work properly.
As for your mod_rewrite code:
[COLOR="Red"]RewriteCond %{QUERY_STRING} ^(.*&)/page1/([0-9]+)?$ [NC][/COLOR]
# Are you trying to redirect FROM the query string version to the non-servable version?
# If so, have a read of the "Loopy" section of my tutorial Article
RewriteRule ^/[COLOR="Blue"]?[/COLOR]page1/([0-9]+)?$ /page2/page1/$2 [R=301,L]
I’m bothered by the fact that you’re not telling us what you’re REALLY trying to do, i.e., SPECIFICITY! With digits in the place of a file, what are you serving? Quite obviously, you’re not giving us the whole picture so we really can’t be of much help (except on troublesome points).