So I want to exchange my PrestaShop installation for Magento CE.

I currently have more than 600 pages in the Google & Bing Indexes, managed by using XML sitemaps and the Google/Bing Webmaster Tools.

Using Magento will result in a different URL format (and I don't even want to keep the PrestaShop URL scheme), so all already indexed pages will have to be updated or redirected.

What is the best solution to handle this without loosing page ranks and negative side effects?


The simplest and best method is to avoid putting rewrite logic into Magento when it should really be done pre-PHP on the web server itself.

Using rewrite rules on your server is the perfect fit and good for tens of thousands of rewrites. You can concatenate rewrites by writing regex patterns to match multiple URLs.

This would be a manual process and require you to populate all the URLs by hand.

If you want something more automated, you could make a Magento module with its own router, then perform a single query based on the old URL, and when importing your catalogue, have an attribute for old URL, so that you can very quickly, and simply redirect traffic.

  • Nice. I would go with the custom router approach. Why didn't I think of that? – Marius Oct 31 '14 at 9:02
  • Unfortunately I have no idea how such a custom router approach could look like. Can you explain that in more details please or point to a source where I can read more about it? Otherwise I think I have no other choice than to add all URLs to be redirected to the htaccess file manually (I'm not a regex guy and don't think it would work in our case), which looks quite cumbersome for aroudn 650 URLs but still reasonable. – Master One Oct 31 '14 at 11:33
  • There's a few pieces to the puzzle @MasterOne, you need to make the router and the DB resource model. The best way to learn Magento is to look at Magento. Use the core as your guide and inspiration, it will teach you more and better than any guide online. – choco-loo Nov 1 '14 at 1:15

You can create url rewrites for each of your pages.
Just insert in the table core_url_rewrite this for each page you already have:

INSERT INTO `core_url_rewrite` SET 
    `store_id` = 1, --or something else if you have more strores--
    `category_id` = NULL,
    `product_id` = NULL,
    `id_path` = 'Generate a random unique string here',
    `request_path` = 'Your prestashop url',
    `target_path` = 'Your magento url',
    `is_system` = 0,
    `options` = 'RP', -- it means it will do a 301 redirect --
    `description` = NULL;
  • I wouldn't recommend this method. The core_url_rewrite table has its problems (reindex bug with URLs with an int at the end), causing endless growth on reindex. It makes more sense to put historical rewrites into the htaccess - its faster for the server to process and avoids bloat in Magento – choco-loo Oct 31 '14 at 8:50
  • I used this method before and didn't have issues, as long as the is_system column is set to 0 for the custom url rewrites. The indexer won't touch these rows. But I see your point and agree that htaccess rewrites are faster. But using magento rewrites it more flexible. – Marius Oct 31 '14 at 9:00
  • I actually meant the system entries can endlessly grow, despite the catalogue staying the same. And you are then faced with the dillema of a truncate with historical URL loss, or a conditional (slow) delete. I see the core_url_rewrite table as disposable, Magento should really store custom and perm redirects in a separate table. – choco-loo Nov 1 '14 at 1:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.