Hey Luigi,
I really appreciate all your help with this. ReDJ is pretty amazing. Unfortunately I still can't get the redirect to work right.
I've now upgraded to Joomla 2.5.9 running Virtuemart 2.0.18a. I also purchased ReDJ Enterprise! I'm running the new Joomla/Virtuemart on a subdirectory (/jupgrade) for now, but that will be changing as soon as this is all working.
It turns out that I need to do some database lookup to make this work since virtuemart wont allow addressing by sku, but thats all I have to reference from because of the previous sites structure.
So, just to refresh your memory on the details, the from url is structured like
www.slashntest.com/jupgrade/00973.html
www.slashntest.com/jupgrade/00034.html
www.slashntest.com/jupgrade/10023.html
These match the product sku with the leading zeros removed and the .html removed, so the sku looks like
973
34
10023
It turns out that I needed to look up those "product_sku" values in the database and find the related virtuemart_product_id
From phpmyadmin I can run this query:
SELECT `virtuemart_product_id`
FROM `j25_virtuemart_products`
WHERE `product_sku` = '973'
and it will return the proper virtuemart_product_id of 1426 . I did notice in phpmyadmin that I had to have the quotes around '973' otherwise it would return the id's of other sku
s including 00973-7, 00973-9, etc... those are my child product variants and I don't need them redirected.
I also need to lookup the category_id which looks like this as an sql query
SELECT `virtuemart_category_id`
FROM `j25_virtuemart_product_categories`
WHERE `virtuemart_product_id` = '1426'
So, for instance the "from url" of
www.slashntest.com/jupgrade/00973.html
should return a "to url" of
www.slashntest.com/jupgrade/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=1426&virtuemart_category_id=26
so it flows like this:
pattern match (5 digits followed by .html) --> remove preceding zeros --> db match that 'product_sku' to the 'virtuemart_product_id' --> db match that to 'virtuemart_category_id' --> finally start structuring the redirect itself...
forgive my syntax, but something like this:
(base url) index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id= (product) &virtuemart_category (category)
sorry to be so long winded, but I wanted to make sure I didn't leave anything out this time
I really appreciate your help!
Thanks,
Matt