Question

This is a problem I noticed that should not be a problem.

Basically in k2 if you have a tag view with a URL path like so:

/menu/k2-root-item/tag-menu-item

You can get a nice clean tag view that looks correct. We have items that need multiple "categories" so to use k2 properly we needed to use tags for this.

So when you have each tag as a menu item (to allow a drop down in the menu). this is what each item will look like.

/menu/k2-root-item/tag-menu-item/item/k2-item

If you know much about SEO, you can see that considering that each item has multiple tags there is a MAJOR flaw with how this is done by k2.

Each page gets as many duplicate pages as it has tags!

I am sure considering the severity of this in SEO purposes, this must of been seen and fixed somewhere, but I fail to see it. default K2 does not have enough SEO options to fix this. The best alternative I can see is to make the link go to the raw k2 item instead everywhere in the site. Like so:

/components/k2/k2-item

That would be MUCH more SEO friendly, however short of hacking K2 I can not find a default option for this.

Looking into the Advanced SEF Settings area. It seems that's where the settings for this should be, however it does not seem to have any way to combine them.

Am I missing something obvious? I find myself overriding K2 too often on things that should already be there. K2 is great but i feel missing these things and not having sufficient documentation is a major flaw.

Was it helpful?

Solution

Based on further research I have found that this is a major flaw in the Joomla! routing file.

Normally this will not hurt most sites much, and a simple plugin can usually repair it. However in sites like the one that this question came up from it uses a vast amount of database rows, and adding more to attempt to remedy this will cause speed issues. So basically trading one problem with another. (this is based on over 15 thousand k2 items on none dedicated hardware).

The only solution is to override the normal templates for displaying the views. Instead of using the typical $item->link, you would use JURI::base().'/component/k2/'.$item->alias. This way each item will always fall under the k2 component, and although the url structure is not ideal it will not have duplicate pages.

OTHER TIPS

Adding a canonical URL in the head of K2 item pages would solve this issue.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top