Stop Virtuemart ignoring my rewritten underscored Product Category SEF aliases

Started by bigrich66, December 22, 2014, 22:00:27 PM

Previous topic - Next topic

bigrich66

Hi all

I know spaces in SEF URLs are better as hyphens rather than underscores for SEO but I'm migrating an existing 'eCommerce' site to Joomla 3 and VM3.

I've installed sh404SEF in Joomla and got it working to address the underscored url rewriting throughout Joomla and I know sh404SEF does not play with VM so I've directed VM in sh404SEF to use the Joomla router. However, I've discovered that VM will let you have underscores in your Product Description aliases and not default them back to hyphens so its an easy process to import all my products using the existing underscored aliases. After that I can rebuild the Product Category Taxonomy manually. However, when I change VM Product Category Aliases to underscores these aliases are being ignored so you get the following

http://www.thesafetycentre.eu/store/wireless-disabled-toilet-alarms/wireless_toilet_alarm_system_ceiling_pull_chord_cranford_controls_wta_trs.php

The above Product Category 'Wireless disabled toilet alarms' has an Alias of wireless_disabled_toilet_alarms in VM but as you can see it is being ignored by VM and reverted to hyphens whereas the Product Category description is fine and remains as underscored. If I could find away of getting VM to let the alias of Product Categories be displayed just like the Product Descriptions I would have a fully working underscored URL that would ensure the client keeps its SEO configuration upon migration.

So far I've checked every post I can find about the VM router.php file to see if it can be hacked to display the underscored Product Category Alias and tried to find a .htaccess rewrite rule that might work without luck so here I am.

Cheers

Versions

PHP Version   5.4.35
Joomla! 3.3.6
VirtueMart 3.0.0
sh404SEF 4.4.6.2271

jjk

I think (but I'm not shure) that you have to look into how Joomla handles the menu item aliases for the VM categories. Joomla sanitizes underscores in menu item aliases and replaces it with hyphens.

Might be better for your client to get rid of the bad SEO underscore URLs and redirect them to good SEO URLs (if your client wants to see his search engine serps ahead of the ones from his competitors :-)
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Milbo

Actually, where is it written that . _ and - is treated differently?

The alias is not done in the router, the alias done is while storing in the vmtable. It transliterates if set in joomla.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/