Item in two different categories and canonical

More
10 years 7 months ago #46383 by b2z
Hello one more time ;)

Testing on version 2.1.3 r1871.

For example I have an item with the title "Some awesome title". I've placed this item in two categories: primary category is "Category1" and secondary is "Category2". So now I can access this item using two different URLs:

mysite.com/category1/some-awesome-title
mysite.com/category2/some-awesome-title

The problem is when I access " mysite.com/category1/some-awesome-title " the canonical is " mysite.com/category1/some-awesome-title ". When I access " mysite.com/category2/some-awesome-title " the canonical is " mysite.com/category2/some-awesome-title ". So for SEO it is not good, because the same item is accessible from two different URLs and the canonical tag does not point to one of the item.

Is it a bug? Should canonical point to primary category?

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago #46386 by ggppdk
Hello

this is done deliberately, since may (or may not) categories may have parameters that effect item display, also the item template maybe behave differently according to current ITEM category,

but we are not sure if this best practice, since the above is rare,

maybe it worth for SEF reason to only use the item's main category in the canonical URL ??


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago #46408 by ggppdk
Hello

i think this is the proper thing to do, by default have the same canonical URL, and maybe add a parameter to allow different if user wants this behaviour.

will make it default behavior to be the same canonical URL:

to apply test the change now, in file

components/com_flexicontent/views/item/view.html.php
change line:
Code:
$ucanonical = $base . JRoute::_(FlexicontentHelperRoute::getItemRoute($item->slug, $item->categoryslug));
to
Code:
$ucanonical = $base . JRoute::_(FlexicontentHelperRoute::getItemRoute($item->slug, $globalcats[$item->catid]->slug));

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago - 10 years 7 months ago #46420 by b2z

maybe it worth for SEF reason to only use the item's main category in the canonical URL ??

Yes I think that only main category should be in the canonical URL.

So I applied your solution and it does not work :( It still works the same way as I mentioned in my first post.
Last edit: 10 years 7 months ago by b2z.

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago #46421 by ggppdk
Hello

since you applied the above,

please send me a PM with 2 frontend item links and i will view the HTML source of them

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago #46422 by b2z
I've sent :) Hope will manage this ;)

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.843 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline