Migrate to LiteCart and redirect old URLs

Assuming you have migrated your products to LiteCart from another platform assigning the same IDs. Here are some good mod_rewrite rules for telling Google and others your pages have moved:

OpenCart:

# Redirect old OpenCart URLs
  RewriteCond %{QUERY_STRING} route=product/category
  RewriteCond %{QUERY_STRING} path=([0-9]+_)?([0-9]+)
  RewriteRule ^index\.php$ /index.php/category?category_id=%2 [R=301,L]

  RewriteCond %{QUERY_STRING} route=product/manufacturer/info
  RewriteCond %{QUERY_STRING} manufacturer_id=([0-9]+)
  RewriteRule ^index\.php$ /index.php/manufacturer?manufacturer_id=%1 [R=301,L]

  RewriteCond %{QUERY_STRING} route=product/product
  RewriteCond %{QUERY_STRING} product_id=([0-9]+)
  RewriteRule ^index\.php$ /index.php/product?product_id=%1 [R=301,L]

osCommerce:

# Redirect old osCommerce URLs
  RewriteCond %{REQUEST_URI} ^(/|/index.php) [NC]
  RewriteCond %{QUERY_STRING} cPath=([0-9]+)
  RewriteRule .* /index.php/category?category_id=%1 [R=301,L]
  RewriteRule ^.*-c-([0-9]+)\.html$ /index.php/category?category_id=$1 [R=301,L]

  RewriteCond %{REQUEST_URI} ^(/|/index.php) [NC]
  RewriteCond %{QUERY_STRING} manufacturers_id=([0-9]+)
  RewriteRule (.*) /index.php/manufacturer?manufacturer_id=%1 [R=301,L]
  RewriteRule ^.*-m-([0-9]+)\.html$ /index.php/manufacturer?manufacturer_id=$1 [R=301,L]

  RewriteCond %{REQUEST_URI} ^/product_info.php [NC]
  RewriteCond %{QUERY_STRING} products_id=([0-9]+)
  RewriteRule (.*) /index.php/product?product_id=%1 [R=301,L]
  RewriteRule ^.*-p-([0-9]+)\.html$ /index.php/product?product_id=$1 [R=301,L]

Be sure to add the rules before:

# No logic for physical files
  RewriteCond %{REQUEST_FILENAME} -d [or]
  RewriteCond %{REQUEST_FILENAME} -f
  RewriteRule ^ - [L]

Wiki article: http://wiki.litecart.net/doku.php?id=redirect_links_from_another_platform

Den här tråden har stängts på grund av lång inaktivitet. Det går inte att posta inlägg till den.
Se kod på GitHub