News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Save your old incomming links after migration

Started by agrupe, June 04, 2012, 20:55:42 PM

Previous topic - Next topic

agrupe

Hi,

I had the same problem as many others. After the migration, the old VM 1.1.9 links where no longer valid.

My old URLs (VM 1.1.9) look like:
http://www....../shop-bereich/24-elko-kits/29-tft-kits/46-samsung/492-elko-kit-samsung-tft-netzteil-bn44-00127l.html

The original VM 2.0.6 URLs look like:
http://www...../shop-bereich/elko-kits/tft-kits/samsung/elko-kit-samsung-tft-netzteil-bn44-00127l-detail.html

My new URLs now look like:
http://www...../shop-bereich/elko-kits/tft-kits/samsung/492-elko-kit-samsung-tft-netzteil-bn44-00127l.html
and can still be reached via the original path.


Here is what I did to solve this issue:

1) Deactivate the appendix of .html in Joomla 2.5
2) Change -detail to .html in VM2.0
3) use a redirect commando in your .htaccess to direct incomming *.html to appendix-free pages: RewriteRule ^([^.]+)\.html /$1 [L,R=301]
4) use the perfect redirect-tool from BanquetTables.pro http://forum.virtuemart.net/index.php?topic=97293.msg342707#msg342707
5) If you have several hundred products like me, it is not nice to make a manual redirect in this tool for every one of them. Instead only redirect your old categories to the new ones
6) Change the "slug" of the related products by SQL-commands

Here are these commands:


First: BACKUP! The commands manipulate your database and your shop might get wracked!

1) add a row with the product sku
alter table j25_virtuemart_products_de_de add product_sku VARCHAR(64)

2)Import SKU from j25_virtuemart_products
UPDATE j25_virtuemart_products_de_de , j25_virtuemart_products SET j25_virtuemart_products_de_de.product_sku = j25_virtuemart_products.product_sku where j25_virtuemart_products_de_de.virtuemart_product_id = j25_virtuemart_products.virtuemart_product_id

3) Change the slut => slut like "hammer" will become "4711-hammer"
I have done this only for products beginning with "KI-" if you will change all products you have to change the SQL code
UPDATE j25_virtuemart_products_de_de, jos_vm_product SET `slug` = concat(jos_vm_product.product_id,"-",`slug`) where (j25_virtuemart_products_de_de.product_sku =  jos_vm_product.product_sku) and j25_virtuemart_products_de_de.product_sku LIKE "KI-%"

4) Delete the now unused sku-row
ALTER TABLE j25_virtuemart_products_de_de DROP `product_sku`


That's it - all old products from VM 1.1.9 will now be reachable via their old URL in VM 2.0.6

Cheers

Andreas


PRO

agrupe,

PLEASE keep in mind, the redirect component I made ONLY does NON-SEF links for 1.1

because it grabs the product_id   etc out of the url

agrupe

If you're not using this plugin just rename the alias of the new categories like the old ones and things will work, too. The advantage of the plugin is, that you get rid of all the odd numbers in the old URLs.

Andreas