Foren

RE: Canonical tags configuration

Liron Levi, geändert vor 11 Jahren.

Canonical tags configuration

New Member Beiträge: 3 Beitrittsdatum: 12.03.12 Neueste Beiträge
Hi Guys,

I notice that in 6.1 Liferay have included automatic canonical tag support which is great.
I was wondering if there is a way to configure these links for specific pages manually, it will be very helpful from SEO aspects.

Thanks,
Liron Levy
thumbnail
Sergio Sánchez, geändert vor 11 Jahren.

RE: Canonical tags configuration

Regular Member Beiträge: 143 Beitrittsdatum: 06.07.11 Neueste Beiträge
Hi Liron. Yes, the canonical tag is generated for Liferay's URLs to prevent some duplicates for cases like:
- the root page for a community
- sites that have a virtual host defined
- uselesss parameters for indexing purposes like the redirect parameter.

the canonical tag is automatically generated.
The alternate tag for all the translations can also be generate, in this case if it is selected in the SEO section for the page.

Would it be helpful for you to have the ability to select when to include or not the canonical tag?
Liron Levi, geändert vor 11 Jahren.

RE: Canonical tags configuration

New Member Beiträge: 3 Beitrittsdatum: 12.03.12 Neueste Beiträge
Hi Sergio,
well it will be definitely beneficial for us to control this ability and additionally have the ability to manually configure the link for every page.
from SEO aspect that are situation in which we need this ability for example we might want to add a canonical link to http:\\sitename.com from some internal page.

Thanks,
Liron
Marina Ra, geändert vor 11 Jahren.

RE: Canonical tags configuration

Junior Member Beiträge: 56 Beitrittsdatum: 13.07.12 Neueste Beiträge
is there a way to create canonical links/tags for single knowledge base articles or wiki pages as well?? i´m having big troubles with that :-/
Peter Kowski, geändert vor 11 Jahren.

RE: Canonical tags configuration

Junior Member Beiträge: 26 Beitrittsdatum: 01.08.12 Neueste Beiträge
Liron Levi:
Hi Guys,
..wondering if there is a way to configure these links for specific pages manually, it will be very helpful from SEO aspects.

I too have been trying to figure out a solution for this same issue, but am not really getting anywhere with my investigations as I am not finding much in documentation or in the forums.

What I am trying to achieve is to make sure that canonical tags are inserted in locations that are displaying some web content in the situuations where the same web content is also available directly elsewhere. I am referring to the case where the web content has already previosly been associated with a page using the functionality described by Jorge in "More flexible linking of web content to full page in Asset Publisher".
In these cases, I would assume that the canonical tag needs to point back to the special URL of the original web content as described by:
Jorge Ferrer:

Whenever the full view of the web content is shown in any other page of the portal, it will automatically add <meta> tags in the page to let search engines know about the canonical URL of the content.

But I can't seem to get this to work. My canonical tags always just point back to the same page that I am on, or at best they point back to the original content if I am viewing the content in a different language locale.

Has anyone else had progress on this front?
Peter Kowski, geändert vor 11 Jahren.

RE: Canonical tags configuration

Junior Member Beiträge: 26 Beitrittsdatum: 01.08.12 Neueste Beiträge
Doesn't anybody have any leads on this? I just upgraded to 6.1 GA2 and the behaviour of the canonical tags seem to be even more erratic.

I will try and demonstrate my issues with the following simple example.
  • Let's say I have a sports news website that has a page displaying a news story about Rafa Nadal winning a grand slam. The friendly URL of the page is:
    www.superportal.com/web/sports/nadal_victory
    This page contains nothing more than a single web content display diplaying a web content called "rafa-nadal-wins-grand-slam".
  • I also have the same Web Content associated with another display page that contains a pre-configured AP. The display page has the following URL:
    www.superportal.com/web/sports/tennis_news_publisher
  • Due to the "display page" configuration in step 2, the original web content can also be called directly via the following URL:
    www.superportal.com/web/sports/-/rafa-nadal-wins-grand-slam
    (The nice thing is that I call any other identically structured web content via the same display page by naming it after the special /-/ delimiter)

To test the canonical tags, I view the pages while not being logged in and have a look at their page sources:
Page 1: In both GA1 and GA2, the canonical URL of Page 1 is its own URL.
Page 2: I am not really interested in Page 2, as it is used just as a display page, and as such users should never really reach it.
Page 3: This page had a canonical tag that pointed to itself in GA1, and in GA2 this has now changed to point to a non-sensical and non-functional URL: www.superportal.com/web/sports/tennis_news_publisher/-/rafa-nadal-wins-grand-slam.

Another thing I have noticed with GA2 is that links in the source code do not appear as is but instead contain unicodes for slashes, ampersands, dots etc.
e.g. link href="http&#x3a;&#x2f;&#x2f;www&#x2e;mysuperportal&#x2e;com&#x3a;8080&#x2f;ar&#x2f;-&#x2f;rafa-nadal-wins-grand-slam"

Can anybody tell me if this behaviour makes any sense, or is it all just riddled with bugs? I would at least assume that page 1 should point to page 3 no?
thumbnail
Sergio Sánchez, geändert vor 11 Jahren.

RE: Canonical tags configuration

Regular Member Beiträge: 143 Beitrittsdatum: 06.07.11 Neueste Beiträge
Thank you for your tests Peter.

I'll try to find out what is happening in GA2 with the asset publisher and those unicode charcaters.

I'll let you know.
Peter Kowski, geändert vor 11 Jahren.

RE: Canonical tags configuration

Junior Member Beiträge: 26 Beitrittsdatum: 01.08.12 Neueste Beiträge
Sergio Sánchez:
Thank you for your tests Peter.

I'll try to find out what is happening in GA2 with the asset publisher and those unicode charcaters.

I'll let you know.

Hi Sergio. Did you manage to make any progress on finding out what is causing URL's to be generated with unicode characters? Very much looking forward to your answer!
Peter Kowski, geändert vor 11 Jahren.

RE: Canonical tags configuration

Junior Member Beiträge: 26 Beitrittsdatum: 01.08.12 Neueste Beiträge
Does nobody have any ideas about this bug? (If indeed it is a bug?)
Peter Kowski, geändert vor 11 Jahren.

RE: Canonical tags configuration

Junior Member Beiträge: 26 Beitrittsdatum: 01.08.12 Neueste Beiträge
Sorry for still trying to escalate this. I am getting quite frustrated with how buggy the CE versions appear and yet there doesn't seem to be too much activity on this forum. The gaps between GA's on the CE and the fact that fairly fundamental issues seem to go unresolved seems to suggest that an upgrade to EE is the only solution, but to be honest so far my experiments and experiences with CE doesn't really give me much confidence in the product. Sorry for the rant!

This is what appears in the source of any of my GA2 pages:
<link href="http&#x3a;&#x2f;&#x2f;localhost&#x3a;8080&#x2f;web&#x2f;sitio-pruebas-rapidas&#x2f;-&#x2f;webcontent-test-1" rel="canonical" />
<link href="http&#x3a;&#x2f;&#x2f;localhost&#x3a;8080&#x2f;en_GB&#x2f;web&#x2f;sitio-pruebas-rapidas&#x2f;-&#x2f;webcontent-test-1" hreflang="en-GB" rel="alternate" />
thumbnail
Sergio Sánchez, geändert vor 11 Jahren.

RE: Canonical tags configuration

Regular Member Beiträge: 143 Beitrittsdatum: 06.07.11 Neueste Beiträge
Hey, I couldn't reproduce it.
Do you have the encoding to UTF-8?
Peter Kowski, geändert vor 11 Jahren.

RE: Canonical tags configuration

Junior Member Beiträge: 26 Beitrittsdatum: 01.08.12 Neueste Beiträge
Sergio Sánchez:

Do you have the encoding to UTF-8?

Yes I do. This is what appears in the top of my source:
<!DOCTYPE html> <html class="ltr" dir="ltr" lang="es-ES"> <head> <title>Titulo</title> <meta content="text/html; charset=UTF-8" http-equiv="content-type" />

I also had a look at the source of another GA2 site (not related to me) and they have the same issue: view-source:http://lcepatchers.org/web/guest

Thanks for your help Sergio. I really am grateful!
Peter Kowski, geändert vor 11 Jahren.

RE: Canonical tags configuration

Junior Member Beiträge: 26 Beitrittsdatum: 01.08.12 Neueste Beiträge
No progress?
thumbnail
Sergio Sánchez, geändert vor 11 Jahren.

RE: Canonical tags configuration

Regular Member Beiträge: 143 Beitrittsdatum: 06.07.11 Neueste Beiträge
Hi, I don't see from lcepatcher any strange characters in the canonical meta tag:

<link rel="canonical" href="https://www.lcepatchers.org/home?p_p_id=58&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&saveLastPath=0&_58_struts_action=%2Flogin%2Fcreate_account">

Browsing different pages all have the canonical OK.
Peter Kowski, geändert vor 11 Jahren.

RE: Canonical tags configuration

Junior Member Beiträge: 26 Beitrittsdatum: 01.08.12 Neueste Beiträge
Thanks for the quick reply Sergio. For the same page that you mentioned, it appears like this for me:
<link href="https&#x3a;&#x2f;&#x2f;www&#x2e;lcepatchers&#x2e;org&#x2f;home&#x3f;p_p_id&#x3d;58&#x26;p_p_lifecycle&#x3d;0&#x26;p_p_state&#x3d;maximized&#x26;p_p_mode&#x3d;view&#x26;saveLastPath&#x3d;0&#x26;_58_struts_action&#x3d;&#x25;2Flogin&#x25;2Fcreate_account" rel="canonical" />
I have tested this from 2 different browsers (firefox and chromium) on my local Ubuntu machine which is configured with language locale EN:GB as well as on the same 2 from a colleague's machine who has his locale en Spanish. I also tried from a windows machine in Chrome, FF and IE7 and it always looks the same.

Conclusion: There must either be something strange on our local network configuration, or something buggy in the code. (or a combination of the 2). I will check from my machine when I get home and report back here.

Thanks once again!
Peter Kowski, geändert vor 11 Jahren.

RE: Canonical tags configuration

Junior Member Beiträge: 26 Beitrittsdatum: 01.08.12 Neueste Beiträge
Hi Sergio,
I checked from 2 other machines outside of my office, and I get the same unicode characters. I checked both my GA2 install as well as the one that I mentioned (lcepatchers). Not sure what is happening.
Tobias Robinson, geändert vor 11 Jahren.

RE: Canonical tags configuration

New Member Beiträge: 2 Beitrittsdatum: 26.10.12 Neueste Beiträge
Hi guys,

I have the same problem in EE GA2. I am developing my themes in windows and deploying to liferay + mysql on a ubuntu server, would there be any encoding issues deploying like this?
thumbnail
Luis Mas, geändert vor 11 Jahren.

RE: Canonical tags configuration

Regular Member Beiträge: 146 Beitrittsdatum: 18.05.09 Neueste Beiträge
I'm viewing the issue with lcepatchers.org in last versions of Chrome, Firefox and Internet Explorer over Windows 8 Spanish version. Did you already open an Issue in https://issues.liferay.com?

<!DOCTYPE html> <html class="ltr" dir="ltr" lang="en-US"> <head> <title>Welcome - lcepatchers.org</title> <meta content="text/html; charset=UTF-8" http-equiv="content-type" /> <link href="https://www.lcepatchers.org/zoe-tech-theme/images/favicon.ico" rel="Shortcut Icon" /> <link href="https&#x3a;&#x2f;&#x2f;www&#x2e;lcepatchers&#x2e;org" rel="canonical" /> <link href="&#x2f;html&#x2f;css&#x2f;main&#x2e;css&#x3f;browserId&#x3d;firefox&#x26;themeId&#x3d;zoetech_WAR_zoetechtheme&#x26;minifierType&#x3d;css&#x26;languageId&#x3d;en_US&#x26;b&#x3d;6101&#x26;t&#x3d;1333360784000" rel="stylesheet" type="text/css" /> <link href="/html/portlet/journal_content/css/main.css?browserId=firefox&amp;themeId=zoetech_WAR_zoetechtheme&amp;minifierType=css&amp;languageId=en_US&amp;b=6101&amp;t=1349769179000" rel="stylesheet" type="text/css" /> <link href="/html/portlet/rss/css/main.css?browserId=firefox&amp;themeId=zoetech_WAR_zoetechtheme&amp;minifierType=css&amp;languageId=en_US&amp;b=6101&amp;t=1349769179000" rel="stylesheet" type="text/css" /> <link href="/social-networking-portlet/members/css/main.css?browserId=firefox&amp;themeId=zoetech_WAR_zoetechtheme&amp;minifierType=css&amp;languageId=en_US&amp;b=6101&amp;t=1352391060000" rel="stylesheet" type="text/css" />
...
</html>

Regards, Luis
Peter Kowski, geändert vor 11 Jahren.

RE: Canonical tags configuration

Junior Member Beiträge: 26 Beitrittsdatum: 01.08.12 Neueste Beiträge
Luis Mas:
I'm viewing the issue with lcepatchers.org in last versions of Chrome, Firefox and Internet Explorer over Windows 8 Spanish version. Did you already open an Issue in https://issues.liferay.com?

Thanks for the test Luis. I have opened an issue now. LPS-30994
Peter Kowski, geändert vor 11 Jahren.

RE: Canonical tags configuration

Junior Member Beiträge: 26 Beitrittsdatum: 01.08.12 Neueste Beiträge
The problems with the unicode characters are not really that major though it does seems something is not right.

The more underlying major issue that I have is that when I display web content as a page in a preconfigured asset publisher, the exact same page can be reached in 2 ways:
1. www.example.com/page/-/asset_publisher/name-of-ap/content/name-of-web-content
2. www.example.com/-/name-of-web-content
This would all be fine if one contains a relevant Canonical tag to the other, but sadly this is not the case. By the way this also happens in GA1 as well. The SEO problem I am having is that I am promoting URL type 2, but search engines are also indexing type 1 and flagging it as multiple content. In my case, the built in taglib-social-bookmark-facebook component displays URL type 1, and that is how search engines get there.
thumbnail
Jörg Halitschke, geändert vor 11 Jahren.

RE: Canonical tags configuration

Junior Member Beiträge: 36 Beitrittsdatum: 15.02.09 Neueste Beiträge
You can fix this in /html/common/themes/top_head.jsp

The right escape method is HtmlUtil.escape() not HtmlUtil.escapeAttribute()

Lines 56 + 73
Tobias Robinson, geändert vor 10 Jahren.

RE: Canonical tags configuration

New Member Beiträge: 2 Beitrittsdatum: 26.10.12 Neueste Beiträge
Jörg Halitschke:
You can fix this in /html/common/themes/top_head.jsp

The right escape method is HtmlUtil.escape() not HtmlUtil.escapeAttribute()

Lines 56 + 73



Thanks Jörg!

This worked for me, I just created a hook with the changes. I noticed now on the liferay site their encoding has the same issue:

<link href="http&#x3a;&#x2f;&#x2f;www&#x2e;liferay&#x2e;com" rel="canonical" /> <link href="http&#x3a;&#x2f;&#x2f;www&#x2e;liferay&#x2e;com&#x2f;zh" hreflang="zh-CN" rel="alternate" /> <link href="http&#x3a;&#x2f;&#x2f;www&#x2e;liferay&#x2e;com&#x2f;fr" hreflang="fr-FR" rel="alternate" /> <link href="http&#x3a;&#x2f;&#x2f;www&#x2e;liferay&#x2e;com&#x2f;de" hreflang="de-DE" rel="alternate" /> <link href="http&#x3a;&#x2f;&#x2f;www&#x2e;liferay&#x2e;com&#x2f;hu" hreflang="hu-HU" rel="alternate" /> <link href="http&#x3a;&#x2f;&#x2f;www&#x2e;liferay&#x2e;com&#x2f;it" hreflang="it-IT" rel="alternate" /> <link href="http&#x3a;&#x2f;&#x2f;www&#x2e;liferay&#x2e;com&#x2f;ja" hreflang="ja-JP" rel="alternate" /> <link href="http&#x3a;&#x2f;&#x2f;www&#x2e;liferay&#x2e;com&#x2f;pt" hreflang="pt-BR" rel="alternate" /> <link href="http&#x3a;&#x2f;&#x2f;www&#x2e;liferay&#x2e;com&#x2f;es" hreflang="es-ES" rel="alternate" /> <link href="http&#x3a;&#x2f;&#x2f;cdn&#x2e;www&#x2e;liferay&#x2e;com&#x2f;html&#x2f;css&#x2f;main&#x2e;css&#x3f;browserId&#x3d;other&#x26;themeId&#x3d;osb_WAR_osbtheme&#x26;minifierType&#x3d;css&#x26;languageId&#x3d;en_US&#x26;b&#x3d;6120&#x26;t&#x3d;1364968999000" rel="stylesheet" type="text/css" />