EC,
If you want to be more experienced in this (mod_rewrite) area, I offer the tutorial article linked in my signature as it was developed and used by many SitePoint members over the last 5-6 years.
I do not like to provide code here because "script kiddies" do not learn and that's my intent for being here ("share the knowledge"). However, your request is so simple, I'll go ahead and help with the code provided you read enough of the tutorial that you understand what the code is doing.
Code:
RewriteEngine on
RewriteCond %{QUERY_STRING} ^main_page=product_info&cPath=8_251_81&products_id=603$
RewriteRule ^index\.php$ http://www.mydomain.com/ [R=301,L]
RewriteCond %{QUERY_STRING} ^cPath=8_17_161$
RewriteRule ^wine-cabinets-perlick-stand-alone-frw$ http://www.mydomain.com/ [R=301,L]
RewriteCond %{QUERY_STRING} ^cPath=8_12_102$
RewriteRule ^dometic-wine-cabinets-dom-cs52vs$ http://www.mydomain.com/ [R=301,L]
You were quite correct in saying that you should use an Apache variable (other than {REQUEST_URI}) to access the query string and, because RewriteRules can only access {REQUEST_URI}, you must use RewriteCond's to test the query string.
I could not combine these three RewriteRule sets because the target scripts (pages?) were different.
Regards,
DK
Bookmarks