Forum Moderators: phranque
Redirect 301 http://example1.com/cart/index.php?cPath=42_65 http://example2.com/index.php/belay-devices/assist-lock-devices.html
Redirect 301 http://example1.com/cart/index.php?cPath=42_67 http://example2.com/index.php/belay-devices/belay-plates-tubes.html
Redirect 301 http://example1.com/cart/index.php?cPath=42_64 http://example2.com/index.php/belay-devices/figure-8-s.html RewriteCond %{HTTP_HOST} ^example1\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example1\.com$
RewriteRule ^cart\/index\.php$ "http\:\/\/example2\.com\/index\.php\/belay\-devices\/belay\-devices\/assist\-lock\-devices\.html" [R=301,L] RewriteCond %{HTTP_HOST} ^example1\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example1\.com$
RewriteCond %{QUERY_STRING} cPath=42_65
RewriteRule ^cart\/index\.php$ "http\:\/\/example2\.com\/index\.php\/belay\-devices\/belay\-devices\/assist\-lock\-devices\.html" [R=301,L] RewriteCond %{HTTP_HOST} ^example1\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example1\.com$
RewriteCond %{QUERY_STRING} cPath=42_65
RewriteRule ^cart\/index\.php$ "http\:\/\/example2\.com\/index\.php\/belay\-devices\/belay\-devices\/assist\-lock\-devices\.html" [R=301,L]
RewriteCond %{HTTP_HOST} ^example1\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example1\.com$
RewriteCond %{QUERY_STRING} cPath=42_67
RewriteRule ^cart\/index\.php$ "http\:\/\/example2\.com\/index\.php\/belay\-devices\/belay\-plates\-tubes\.html" [R=301,L]
RewriteCond %{HTTP_HOST} ^example1\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example1\.com$
RewriteCond %{QUERY_STRING} cPath=42_64
RewriteRule ^cart\/index\.php$ "http\:\/\/example2\.com\/index\.php\/belay\-devices\/figure\-8\-s\.html" [R=301,L] RewriteRule ^cart\/index\.php$
RewriteCond %{HTTP_HOST} ^example1\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example1\.com$
RewriteCond %{QUERY_STRING} ^cPath=42_65
RewriteRule ^(.*)$ "http\:\/\/example2\.com\/index\.php\/belay\-devices\/belay\-devices\/assist\-lock\-devices\.html" [R=301,L] RewriteCond %{HTTP_HOST} ^example1\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example1\.com$
RewriteCond %{QUERY_STRING} cPath=42_65
RewriteRule ^cart\/index\.php$ "http\:\/\/example2\.com\/index\.php\/belay\-devices\/belay\-devices\/assist\-lock\-devices\.html" [R=301,L]
RewriteCond %{HTTP_HOST} ^example1\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example1\.com$
RewriteRule ^cart\/index\.php$ "http\:\/\/example2\.com\/index\.php\/belay\-devices\/belay\-devices\/assist\-lock\-devices\.html" [R=301,L]
in your RewriteRule you use "L" which means last rule, a directive to the system to stop looking further
[edited by: phranque at 11:43 am (utc) on Jul 27, 2016]
[edit reason] edit of regex typo requested by lucy24 [/edit]
RewriteCond %{HTTP_HOST} ^(www\.)example\.com
RewriteCond %{QUERY_STRING} ^cPath=42_65
RewriteRule ^(.*)$ http://example2.com/index.php/belay-devices/belay-devices/assist-lock-devices.html [R=301,L]
RewriteRule ^(.*)$