X-Cart to Woocommerce redirects

DanH

Free Member
  • Jan 5, 2010
    247
    33
    Hi,

    I'm currently migrating an X-Cart installation into Woocommerce. Most of it is straightforward apart from the existing URLs, where some of them rank rather well in Google, so I want topreserve them. Woocommerce advises me against:

    "Removing /product/, /product-category/, or /shop/ from the URLs is not advisable due to the way WordPress resolves its URLs."

    That in itself wouldn't be so bad if the X-Cart installation had a similar structure so I could send product/product category prefixed URLs to the Woocommerce equivalents. However, literally every product/category/page in X-Cart resides in the root of the domain with no subdirectory separation. The only way I think I can realistically do it is to have a 500 odd line htaccess with individual 301s. Whilst the size of the ensuing htaccess scares me, when I read this:


    I don't feel so scared! Anyone have any htaccess redirects of the several hundred magnitude that doesn't impact on the performance too badly?

    Thanks

    Dan
     
    Hi Dan,

    I moved a large ecom site and had the same issue, we just wrote a php script that did a SQL lookup for the redirects, set them to 301, and included a counter.

    We could then see what links were being hit and when so it was easy to filter down with time

    Darren
     
    • Like
    Reactions: DanH
    Upvote 0
    Thanks Darren,

    I'm guessing that was less resourceful than a line-by-line htaccess equivalent? It wouldn't take me long to create the 500 odd line htaccess file to cover all URLs and I could keep an eye on the analytics and get rid a couple of years down the line...less swish than your method though!
     
    Upvote 0
    It's what ever works, 500 URLs are probably fine, I had to do it for several thousand

    Yes it was more or less instant, you certainly couldn't see it and we had no SEO hit from it
     
    • Like
    Reactions: DanH
    Upvote 0
    just remove the /product/ from urls in woo, as long as the seo urls dont ever clash between the taxonomies there will never be any issue.

    I do this on almost all projects to get nice URLS, the way woo does it by default is awful.
     
    • Like
    Reactions: DanH
    Upvote 0
    That's what I thought but the various sources I've seen say not to, not just because of the potential URL clash, but because of the overhead in how Woo looks up the URL:

    What would happen if we remove that ‘product-category’ part?
    WordPress will have to do much more work to detect what page you are looking for when entering one of the above URLs.

    ....although can't imagine that would be a huge overhead, would it?
     
    Upvote 0
    Never had any issues, but you should have a cache plugin anyway as wordpress is quite heavy by design (one flat table for everything) in how it works.
    Even with a caching plugin woocommerce is a hog. Bolt on a couple of extension plugins and it can really clog up.

    Avoid using woo commerce if you have a lot of products.
     
    • Like
    Reactions: DanH
    Upvote 0
    Depending on how many redirects you have this could potentially cause you a lot of issues - especially if you plan on cacheing too. The redirection plugin is pretty good, and you can import a CSV with all your redirect on to make things easier. However, if the redirects are fairly uniform you may want to consider using htaccess redirects as they would be quicker and less intrusive. I wouldn't recommend messing around with slugs and permalinks as you can very quickly dig yourself a hole. The benefit with the redirects is that over 6 months (often much quicker) the search engines will be reindexing your pages with your new links and you can drop off the redirects. I think though that it would be worth using a tool like ahrefs.com to find your best backlinks and then change some of those manually to the new link so when you do eventually drop off the redirects you'll still get all the juice.
     
    Last edited by a moderator:
    Upvote 0

    Latest Articles