I am migrating from a oscommerce to a new shopping cart. I need help with a wildcard redirect... I need all three of these to go to the same place: /catalog/product_info.php/cPath/1/products_id/1234 /catalog/product_info.php/products_id/1234 /catalog/product_info.php/manufacturers_id/2/products_id/1234 all should be directed to: /product/1234 Can I just do: RewriteRule ^products_id/(.*) /product/$1 I've been messing with this, but it doesn't seem to be working correctly.
RewriteRule ^catalog\/product_info\.php\/cPath\/1\/products_id/([0-9]+)$ /product/$1 RewriteRule ^catalog\/product_info\.php\/products_id\/([0-9]+)$ /product/$1 RewriteRule ^catalog\/product_info\.php\/manufacturers_id\/2\/products_id\/([0-9]+)$ /product/$1 Code (markup): Untested, but give it a try.
EDIT: ^^ Maybe with the | operator. Uh, yeah. Try this. (Untested) RedirectMatch 301 ^catalog\/product_info\.php/(cPath\/1\/(products_id)?|manufacturers_id\/2\/)\/([0-9]+)$ /product/$1 Code (markup):
Try this: RewriteEngine On RewriteBase /catalog/ RewriteRule ^product_info\.php(/.*/)?\/product_id/([0-9]+) /product/$2&%{QUERY_STRING} Code (markup): Paste this in the htaccess file located in the /catalog/ directory. Bobby