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=(.+)<br />
RewriteRule ^index\.php$ index.php?dispatch=categories.view&category_id=%1 [R=301,L]<br />
RewriteCond %{QUERY_STRING} target=products&product_id=(.+)<br />
RewriteRule ^index\.php$ index.php?dispatch=products.view&product_id=%1 [R=301,L]
```<br />
<br />
After:<br />
<br />
```php
RewriteEngine on<br />
# Some hostings require RewriteBase to be uncommented<br />
# Example:<br />
# Your store url is http://www.yourcompany.com/store/cart<br />
# So "RewriteBase" should be:<br />
# RewriteBase /store/cart <br />
RewriteBase /
```<br />
<br />
This will work either with your SEO addon on or off.<br />
<br />
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.<br />
<br />
Thanks,<br />
<br />
Brandon

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