I'm gonna implement a new design / website structure for a customer, but I have a little problem. Since the URLs I've created are a bit different, I'm anticipating a problem with the SEO rankings due to the bunch of broken URLs. My idea is to match the existing URLs (from the old site) with the new ones I've created.
The problem I've stumbled upon is the following:
The old URLs are like
http://www.example.com/category/numeric_id-item-name_item_code.html and the new URLs are like
In MySQL I created a new database containing on the first column the item_name and item_code from the old website and a second column the same info from the new database.
The idea is as it follows:
Example: Let's say we have an item named spring leaf with the code sl34. The old URL would be something like
For matching this URL there are 3 possibilities:
I need help on creating these matches.
So, apparently, I've found some kind of quick fix:
CREATE VIEW `database`.`url_view` AS (SELECT old_table.old_url, new_table.new_url FROM old_table LEFT JOIN new_table ON old_table.product_code=new_table.product_code);
This will associate the old URLs with the new ones, and, if an old URL (product) is no longer available it will insert a (NULL) entry.