我需要通过htaccess永久重定向动态创建的php地址

I have an installation of Oscommerce which google has indexed duplicates of pages for some reason. I cannot delete the duplicates as they are not actual files, but instead dynamically generated by the php script. So I need to create a permanent 301 redirect through htaccess to tell google to stop indexing these pages and instead redirect to the real address. I want used on the website, and then show that real address in the browser window.

Here is what's going on. The correct web address of one page, for example, is http://www.realmessiah.name/?cPath=49_40&products_id=101 and google is indexing that page, but also a mirror duplicate with &osCid=91c3c392e4de301895f0bbfb5a5582c2 tacked onto the end of it.

So here is what I tried:

RewriteRule ^privacy.php "/index.php" [R=301,L]

This works on a non-dynamically generated php filename. Both files presently exist. Go to www.realmessiah.name/privacy.php and it automatically redirects to index.php instead. But when I try with a dynamically generated php addres as so:

RewriteRule ^product_info.php?cPath=49_40&products_id=101&osCid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_28&products_id=45" [R=301,L]

It just takes you to the original address and ignores the rewrite command

What am I doing wrong that it will work for the non-dynamically generated code and not the others? Is there another or better way to resolve this?

Here is the full contents of the .htaccess file. I have alot of these dynamically generated addresses with slight variations leading to the same URL creating duplicates of the same page multiple times on google. How google ever got ahold of all the variation in the address coding I don't know, so I'm trying to clean it up by forcing the website to stick to what's supposed to be the standard format for each address, and sent google a 301 for any variations.

Existing .htaccess contents

ErrorDocument 404 /404.php

RewriteEngine On
RewriteCond %{HTTP_HOST} ^realmessiah.name
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule (.*) http://www.realmessiah.name/$1 [R=301,L]

RewriteEngine on 
Options +FollowSymlinks 
RewriteCond %{SERVER_PORT} ^443$ 
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^robots.txt$ robots_ssl.txt


#THESE CODES WORK

RewriteEngine On
RewriteRule ^index.php "/" [R=301,L]
RewriteRule ^privacy.php "index.php"" [R=301,L]


#FROM HERE ON THESE CODES DONT WORK

RewriteRule ^product_info.php?cPath=49_40&products_id=101&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_28&products_id=45" [R=301,L]


RewriteRule ^product_info.php?products_id=122&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_33&products_id=47" [R=301,L]


RewriteRule ^product_info.php?cPath=49_40&products_id=89&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_26&products_id=46" [R=301,L]


RewriteRule ^product_info.php?cPath=49_44&products_id=70&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_26&products_id=38" [R=301,L]


RewriteRule ^product_info.php?cPath=49_40&products_id=71&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_31&products_id=42" [R=301,L]


RewriteRule ^product_info.php?cPath=49_39_35&products_id=58&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_31&products_id=55" [R=301,L]


RewriteRule ^product_info.php/products_id/116$ "/product_info.php?cPath=25&products_id=59" [R=301,L]


RewriteRule ^product_info.php/products_id/87$ "/product_info.php?cPath=22_27&products_id=35" [R=301,L]


RewriteRule ^product_info.php/products_id/77$ "/product_info.php?cPath=23&products_id=67" [R=301,L]


RewriteRule ^product_info.php?products_id=119&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=25&products_id=57" [R=301,L]


RewriteRule ^product_info.php/products_id/119$ "/product_info.php?cPath=25&products_id=57" [R=301,L]


RewriteRule ^product_info.php/products_id/90$ "/product_info.php?cPath=22_26&products_id=39" [R=301,L]


RewriteRule ^product_info.php?cPath=24&products_id=55&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=23&products_id=62" [R=301,L]


RewriteRule ^product_info.php?products_id=92&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_28&products_id=37" [R=301,L]


RewriteRule ^product_info.php?products_id=117&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=25&products_id=58" [R=301,L]


RewriteRule ^product_info.php?cPath=26_48&products_id=57&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=25&products_id=60" [R=301,L]


RewriteRule ^product_info.php?cPath=24&products_id=73&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=23&products_id=64" [R=301,L]


RewriteRule ^product_info.php/cPath/24/products_id/73$ "/product_info.php?cPath=23&products_id=64" [R=301,L]


RewriteRule ^product_info.php?products_id=98&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_35&products_id=76" [R=301,L]


RewriteRule ^product_info.php?cPath=49_43&products_id=98&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_35&products_id=76" [R=301,L]


RewriteRule ^product_info.php?cPath=49_44&products_id=35&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_26&products_id=40" [R=301,L]


RewriteRule ^product_info.php/cPath/44/products_id/35$ "/product_info.php?cPath=22_26&products_id=40" [R=301,L]


RewriteRule ^product_info.php/products_id/35$ "/product_info.php?cPath=22_26&products_id=40" [R=301,L]


RewriteRule ^product_info.php?products_id=35&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_26&products_id=40" [R=301,L]


RewriteRule ^product_info.php/cPath/38/products_id/126_top$ "/product_info.php?cPath=22_27&products_id=32" [R=301,L]


RewriteRule ^product_info.php?currency=EUR&products_id=126$ "/product_info.php?cPath=22_27&products_id=32" [R=301,L]


RewriteRule ^product_info.php/products_id/126$ "/product_info.php?cPath=22_27&products_id=32" [R=301,L]


RewriteRule ^product_info.php/cPath/38/products_id/126$ "/product_info.php?cPath=22_27&products_id=32" [R=301,L]


RewriteRule ^product_info.php?products_id=126&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_27&products_id=32" [R=301,L]


RewriteRule ^index.php/cPath/43/osCsid/0a03e6d6b8afd8ff45986d6aa3f858e8$ "/index.php?cPath=22_35" [R=301,L]


RewriteRule ^index.php?cPath=49_43&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/index.php?cPath=22_35" [R=301,L]


RewriteRule ^index.php/cPath/43$ "/index.php?cPath=22_35" [R=301,L]


RewriteRule ^product_info.php?cPath=49_40&products_id=91&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_31&products_id=44" [R=301,L]


RewriteRule ^product_info.php/products_id/91$ "/product_info.php?cPath=22_31&products_id=44" [R=301,L]


RewriteRule ^product_info.php?cPath=49_39_45&products_id=122&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_33&products_id=47" [R=301,L]


RewriteRule ^product_info.php/products_id/122$ "/product_info.php?cPath=22_33&products_id=47" [R=301,L]


RewriteRule ^product_info.php/products_id/31$ "/product_info.php?cPath=23&products_id=66" [R=301,L]


RewriteRule ^product_info.php?products_id=31&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=23&products_id=66" [R=301,L]


RewriteRule ^product_info.php?cPath=24&products_id=31&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=23&products_id=66" [R=301,L]


RewriteRule ^product_info.php/products_id/83$ "/product_info.php?cPath=23&products_id=65" [R=301,L]


RewriteRule ^product_info.php?cPath=24&products_id=83&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=23&products_id=65" [R=301,L]


RewriteRule ^product_info.php?products_id=83&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=23&products_id=65" [R=301,L]


RewriteRule ^product_info.php?products_id=61&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_34&products_id=48" [R=301,L]


RewriteRule ^product_info.php?cPath=49_39_46&products_id=61&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_34&products_id=48" [R=301,L]


RewriteRule ^product_info.php/products_id/61$ "/product_info.php?cPath=22_34&products_id=48" [R=301,L]


RewriteRule ^product_info.php?products_id=60&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_27&products_id=36" [R=301,L]


RewriteRule ^product_info.php/cPath/21/products_id/60$ "/product_info.php?cPath=22_27&products_id=36" [R=301,L]


RewriteRule ^product_info.php/products_id/60/action/notify$ "/product_info.php?cPath=22_27&products_id=36" [R=301,L]


RewriteRule ^product_info.php/cPath/44/products_id/60$ "/product_info.php?cPath=22_27&products_id=36" [R=301,L]


RewriteRule ^product_info.php/cPath/21/products_id/113$ "/product_info.php?cPath=22&products_id=68" [R=301,L]


RewriteRule ^product_info.php?currency=USD&products_id=113$ "/product_info.php?cPath=22&products_id=68" [R=301,L]


RewriteRule ^product_info.php/products_id/113$ "/product_info.php?cPath=22&products_id=68" [R=301,L]


RewriteRule ^product_info.php?currency=CAD&products_id=121$ "/product_info.php?cPath=22_28&products_id=43" [R=301,L]


RewriteRule ^product_info.php/cpath/31/products_id/121_top$ "/product_info.php?cPath=22_28&products_id=43" [R=301,L]


RewriteRule ^product_info.php?currency=AUD&path=31&products_id=121_top$ "/product_info.php?cPath=22_28&products_id=43" [R=301,L]


RewriteRule ^product_info.php?currency=MXP&path=31&products_id=121_top$ "/product_info.php?cPath=22_28&products_id=43" [R=301,L]


RewriteRule ^product_info.php?currency=CAD&cPath=40&products_id=121$ "/product_info.php?cPath=22_28&products_id=43" [R=301,L]


RewriteRule ^product_info.php?currency=EUR&cPath=40&products_id=121$ "/product_info.php?cPath=22_28&products_id=43" [R=301,L]


RewriteRule ^product_info.php?currency=AUD&cPath=40&products_id=121$ "/product_info.php?cPath=22_28&products_id=43" [R=301,L]


RewriteRule ^product_info.php?cPath=49_40&products_id=121&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_28&products_id=43" [R=301,L]


RewriteRule ^product_info.php?currency=MXP&products_id=121$ "/product_info.php?cPath=22_28&products_id=43" [R=301,L]


RewriteRule ^product_info.php/products_id/121$ "/product_info.php?cPath=22_28&products_id=43" [R=301,L]


RewriteRule ^product_info.php/cPath/31/products_id/121$ "/product_info.php?cPath=22_28&products_id=43" [R=301,L]


RewriteRule ^product_info.php?products_id=129&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_30&products_id=53" [R=301,L]


RewriteRule ^product_info.php?cPath=49_39_35&products_id=129&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_30&products_id=53" [R=301,L]


RewriteRule ^product_info.php?products_id=131&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_30&products_id=52" [R=301,L]


RewriteRule ^product_info.php/cPath/39_35/products_id/131$ "/product_info.php?cPath=22_30&products_id=52" [R=301,L]


RewriteRule ^product_info.php/products_id/131$ "/product_info.php?cPath=22_30&products_id=52" [R=301,L]


RewriteRule ^product_info.php/products_id/133$ "/product_info.php?cPath=22_32&products_id=50" [R=301,L]


RewriteRule ^product_info.php?products_id=133&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_32&products_id=50" [R=301,L]


RewriteRule ^product_info.php/products_id/117$ "/product_info.php?cPath=25&products_id=58" [R=301,L]


RewriteRule ^product_info.php?cPath=26_47&products_id=117&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=25&products_id=58" [R=301,L]


RewriteRule ^product_info.php?products_id=132&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_34&products_id=54" [R=301,L]


RewriteRule ^product_info.php?cPath=49_39_35&products_id=132&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_34&products_id=54" [R=301,L]


RewriteRule ^product_info.php/products_id/132$ "/product_info.php?cPath=22_34&products_id=54" [R=301,L]


RewriteRule ^product_info.php/products_id/94$ "/product_info.php?cPath=22_34&products_id=49" [R=301,L]


RewriteRule ^product_info.php?cPath=49_39_46&products_id=94&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_34&products_id=49" [R=301,L]


RewriteRule ^product_info.php?products_id=124&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_35&products_id=34" [R=301,L]


RewriteRule ^product_info.php?currency=CAD&products_id=124$ "/product_info.php?cPath=22_35&products_id=34" [R=301,L]


RewriteRule ^product_info.php?currency=EUR&products_id=124$ "/product_info.php?cPath=22_35&products_id=34" [R=301,L]


RewriteRule ^products_info.php/products_id/130$ "/product_info.php?cPath=22_30&products_id=51" [R=301,L]


RewriteRule ^product_info.php/cPath/38/products_id/125$ "/product_info.php?cPath=22_27&products_id=33" [R=301,L]


RewriteRule ^product_info.php/products_id/125$ "/product_info.php?cPath=22_27&products_id=33" [R=301,L]


RewriteRule ^product_info.php/cpath/21/products_id/126_top$ "/product_info.php?cPath=22_27&products_id=33" [R=301,L]


RewriteRule ^product_info.php/cPath/38/products_id/125_top$ "/product_info.php?cPath=22_27&products_id=33" [R=301,L]


RewriteRule ^product_info.php?currency=USD&products_id=125$ "/product_info.php?cPath=22_27&products_id=33" [R=301,L]


RewriteRule ^product_info.php?products_id=125&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_27&products_id=33" [R=301,L]


RewriteRule ^product_info.php/products_id/125/oCsid/fb449a87d7cb8bc0e0db995c048391d8$ "/product_info.php?cPath=22_27&products_id=33" [R=301,L]


RewriteRule ^product_info.php/cPath/21_44/products_id/40$ "/product_info.php?cPath=22_27&products_id=33" [R=301,L]


RewriteRule ^index.php/cPath/38/osCsid/fb449a87d7cb8bc0e0db995c048391d8$ "/index.php?cPath=22_27" [R=301,L]


RewriteRule ^index.php/cPath/38$ "/index.php?cPath=22_27" [R=301,L]


RewriteRule ^index.php?cPath=49_38&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/index.php?cPath=22_27" [R=301,L]


RewriteRule ^index.php/cPath/41/osCsid/fb449a87d7cb8bc0e0db995c048391d8$ "/index.php?cPath=22_29" [R=301,L]


RewriteRule ^index.php?cPath=49_41&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/index.php?cPath=22_29" [R=301,L]


RewriteRule ^index.php/cPath/41$ "/index.php?cPath=22_29" [R=301,L]


RewriteRule ^index.php?cPath=49_39_35&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/index.php?cPath=22_30" [R=301,L]


RewriteRule ^index.php?cPath=49_39_46&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/index.php?cPath=22_34" [R=301,L]


RewriteRule ^index.php?cPath=49_39_46&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/index.php?cPath=22" [R=301,L]


RewriteRule ^index.php?cPath=49&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/index.php?cPath=22" [R=301,L]


RewriteRule ^index.php?cPath=49_40&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/index.php?cPath=22_28" [R=301,L]


RewriteRule ^index.php/cPath/40$ "/index.php?cPath=22_28" [R=301,L]


RewriteRule ^index.php/cPath/40/osCsid/fb449a87d7cb8bc0e0db995c048391d8$ "/index.php?cPath=22_28" [R=301,L]


RewriteRule ^index.php?cPath=49_44&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/index.php?cPath=22_27" [R=301,L]


RewriteRule ^index.php/cPath/39_45$ "/index.php?cPath=22_33" [R=301,L]


RewriteRule ^index.php?cPath=49_39_45&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/index.php?cPath=22_33" [R=301,L]


RewriteRule ^index.php/cPath/39$ "/index.php?cPath=22_33" [R=301,L]


RewriteRule ^index.php?cPath=49_39&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/index.php?cPath=22_33" [R=301,L]


RewriteRule ^index.php/cPath/39_46$ "/index.php?cPath=22_33" [R=301,L]


RewriteRule ^index.php/cPath/39/osCsid/fb449a87d7cb8bc0e0db995c048391d8$ "/index.php?cPath=22_33" [R=301,L]


RewriteRule ^index.php/cPath/44/osCsid/fb449a87d7cb8bc0e0db995c048391d8$ "/index.php?cPath=22_27" [R=301,L]


RewriteRule ^index.php?cPath=42&osCsid=aa0f2a03a35a499c65b7f43e34ca759f$ "/index.php?cPath=24" [R=301,L]


RewriteRule ^index.php?cPath=24&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/index.php?cPath=23" [R=301,L]


RewriteRule ^index.php/cPath/24$ "/index.php?cPath=23" [R=301,L]


RewriteRule ^product_info.php/cPath/41/products_id/115$ "/product_info.php?cPath=22_29&products_id=56" [R=301,L]


RewriteRule ^product_info.php?currency=EUR&products_id=115$ "/product_info.php?cPath=22_29&products_id=56" [R=301,L]


RewriteRule ^product_info.php?cPath=49_41&products_id=115&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_29&products_id=56" [R=301,L]


RewriteRule ^product_info.php?products_id=115&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_29&products_id=56" [R=301,L]


RewriteRule ^product_info.php/products_id/115$ "/product_info.php?cPath=22_29&products_id=56" [R=301,L]


RewriteRule ^product_info.php?&products_id=115&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_29&products_id=56" [R=301,L]


RewriteRule ^product_info.php?currency=EUR&cPath=38&products_id=125_top$ "/product_info.php?cPath=22_27&products_id=33" [R=301,L]


RewriteRule ^product_info.php?currency=CAD&cPath=38&products_id=125_top$ "/product_info.php?cPath=22_27&products_id=33" [R=301,L]


RewriteRule ^product_info.php?currency=USD&cPath=38&products_id=125_top$ "/product_info.php?cPath=22_27&products_id=33" [R=301,L]


RewriteRule ^product_info.php?currency=AUD&cPath=38&products_id=125_top$ "/product_info.php?cPath=22_27&products_id=33" [R=301,L]


RewriteRule ^product_info.php/cPath/21/products_id/87$ "/product_info.php?cPath=22_27&products_id=33" [R=301,L]


RewriteRule ^product_info.php?cPath=49_38&products_id=43&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_27&products_id=33" [R=301,L]


RewriteRule ^product_info.php/cPath/21/products_id/126$ "/product_info.php?cPath=22_27&products_id=33" [R=301,L]


RewriteRule ^product_info.php?currency=MXP&products_id=125$ "/product_info.php?cPath=22_27&products_id=33" [R=301,L]


RewriteRule ^product_info.php?currency=AUD&products_id=125$ "/product_info.php?cPath=22_27&products_id=33" [R=301,L]


RewriteRule ^index.php/cPath/26_47$ "/index.php?cPath=25" [R=301,L]


RewriteRule ^index.php?cPath=26_47&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/index.php?cPath=25" [R=301,L]


RewriteRule ^index.php?cPath=26_48&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/index.php?cPath=25" [R=301,L]


RewriteRule ^index.php/cPath/26/osCsid/fb449a87d7cb8bc0e0db995c048391d8$ "/index.php?cPath=25" [R=301,L]


RewriteRule ^product_info.php/products_id/128$ "/product_info.php?cPath=23&products_id=61" [R=301,L]


RewriteRule ^product_info.php?cPath=24&products_id=128&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=23&products_id=61" [R=301,L]


RewriteRule ^product_info.php?products_id=128&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=23&products_id=61" [R=301,L]


RewriteRule ^product_info.php?cPath=49_43&products_id=62&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_35&products_id=75" [R=301,L]


RewriteRule ^product_info.php?products_id=62&osCsid=91c3c392e4de301895f0bbfb5a5582c2$ "/product_info.php?cPath=22_35&products_id=75" [R=301,L]

So you just want to drop that osCid parameter from the query string, leaving other parameters intact, right? Try this:

RewriteEngine on
RewriteBase /

# Make sure it's not an actual file or directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Match the host
RewriteCond %{HTTP_HOST} ^www\.realmessiah\.name$

# Match the query string, extracting cPath as %1 and products_id as %2
RewriteCond %{QUERY_STRING} ^cPath=(.*)&products_id=(.*)&osCid=.*$

# Rewrite the URI using the extracted query string params
RewriteRule ^(.*)$ $1?cPath=%1&products_id=%2 [L,R=301]

You can test it online, if you wish.

The important thing that you need to understand, is that rewrite rules do not rewrite files to files. They rewrite URIs. So, there are no limitations even though the pages are being dynamically generated.

Update 1

As you stated, there was a problem with the rewrite code I provided.

I noted that it works if the URL being accessed does not map to an actual file. But it fails otherwise. For example, if http://www.realmessiah.name/ is being accessed, as it actually maps to a real file on the filesystem (index.php for example), the rewrite rules will be discarded by the effect of RewriteCond %{REQUEST_FILENAME} !-f.

We can safely remove those conditions and make it work again, as we're strictly checking that the query string must be started with that sequence of parameters. So:

RewriteEngine on
RewriteBase /

# Match the host
RewriteCond %{HTTP_HOST} ^www\.realmessiah\.name$

# Match the query string, extracting cPath as %1 and products_id as %2
RewriteCond %{QUERY_STRING} ^cPath=(.*)&products_id=(.*)&osCid=.*$

# Rewrite the URI using the extracted query string params
RewriteRule ^(.*)$ $1?cPath=%1&products_id=%2 [L,R=301]

It's tested both on that htaccess simulator and a real apache httpd server.

A few notes about your existing htaccess:

  • You don't need multiple RewriteEngine On directives. Enable the engine once and you're done.
  • I see that you're rewriting some product IDs to some other. For example, you're rewriting the URI for products_id=92 to the URI for products_id=37, mapping different product IDs. If that's the case, be aware, that a generic rewrite rule (as I provided) can only rewrite URIs blindly as it has no idea how to map different product IDs. You might want to have a look at RewriteMap directive to clean up your htaccess a bit and read from a .txt file.
  • Read about the L flag and make sure you're utilizing it correctly. To quote the manual:

    The [L] flag causes mod_rewrite to stop processing the rule set. In most contexts, this means that if the rule matches, no further rules will be processed. Use this flag to indicate that the current rule should be applied immediately without considering further rules.

Update 2

Your question was misleading, as it states that the source URI is:

http://www.realmessiah.name/?cPath=49_40&products_id=101

But according to the actual site content and your htaccess contents, I assume you're trying to rewrite this URI as the source:

http://www.realmessiah.name/product_info.php?cPath=22_28&products_id=45

If that's the case, you might want to change the last line of the rules I provided to make it specific to the product_info.php URIs not other ones:

RewriteRule ^product_info\.php$ product_info.php?cPath=%1&products_id=%2 [L,R=301]

The note I mentioned about generic rewrite rules, applies here as well.

Update 3

But if you just want the rewrite syntax for a single rewrite to map different product IDs, here it is:

# As you're hardcoding the values into rules, you need multiple of 
# these RewriteCond/RewriteRule combinations.
RewriteCond %{QUERY_STRING} ^cPath=49_40&products_id=101&osCid=91c3c392e4de301895f0bbfb5a5582c2$
RewriteRule ^product_info\.php$ product_info.php?cPath=22_28&products_id=45 [R=301,L]

Your problem was that you were matching against the query string in a RewriteRule directive. These directives are only able to match against the %{REQUEST_URI}. If you need to match against any other variables, you need to use a RewriteCond directive.