301 redirects between 1.3.5 sp3 and 2.1.4

Well, I just upgraded a site from 1.3.5 sp3 to 2.1.4 and had a heck of a time with the links. The biggest problem was because CS-Cart went from target to dispatch.



I tried everything I could think of to get the redirects to work and just couldn’t get it. I posted here on the forum, I posted a bug in the bug tracker, I contacted a couple of forum members directly, I posted over on a different forum, but yet, I still couldn’t figure out how to solve this.



Finally I posted the job over on Odesk. I ran the job a little different than other jobs I’ve done. Basically, I posted the job saying that I was in a hurry and that the first person who came up with the solution would get paid.



I had 4 or 5 different people working on this and it was really not looking good for me. Then, finally, one of the guys came up with a solution that worked perfectly.



So, for the solution:



To redirect pages from CS-Cart 1.3.5 sp3 to 2.1.4 In you .htaccess, just add:


RewriteCond %{QUERY_STRING} target=categories&category_id=(.+)
RewriteRule ^index\.php$ index.php?dispatch=categories.view&category_id=%1 [R=301,L]
RewriteCond %{QUERY_STRING} target=products&product_id=(.+)
RewriteRule ^index\.php$ index.php?dispatch=products.view&product_id=%1 [R=301,L]




After:


```php RewriteEngine on

Some hostings require RewriteBase to be uncommented

Example:

Your store url is http://www.yourcompany.com/store/cart

So “RewriteBase” should be:

RewriteBase /store/cart

RewriteBase / ```



This will work either with your SEO addon on or off.



I really hope this helps someone in the future and makes it so that you don’t have to spend the hours and hours like I did to try and figure this out.



Thanks,



Brandon

Very nice, just added it. Hopefully it will help some of the redirects from our upgrade.