One of the disadvantages of dynamically generated SEO urls is, that they change when the site structure or even alias-names, category-names ... are changed. We just had the request that somebody has entered a test value in his Virtuemart-Menu-Item alias and he wanted to change this to something else.
He first entered "products-mainmenu" to identify it better and now he wanted to change it to "shop". But Google was faster. The whole site with all products was indexed with the "wrong" alias in the URL. After he changed the alias, all the links from Google showed a 404 error.
You could now handle this by writing a little php-script that redirects the wrong URLs to the correct page - but there is an easier and faster way! Edit the .htaccess file in the root-directory of your Joomla-Setup and insert the following line right after the existing line "RewriteEngine On":
Replace the "wrong-part-of-url" with the old alias (in our case "products-mainmenu"), "your-domain.com" with the domain of your shop and finally "correct-part" with the new alias (in our case "shop").
After that, the searchengine-links will lead to the correct pages and also the searchengine will learn the new URL (done by the code 301 = moved permanently).
VM-Expert.com is part of the B01 Consulting Network. Since 2003 we build shops and websites with Joomla and Virtuemart. We are specialised in developing custom Joomla and Virtuemart Extensions.