Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-74031

Canonical URL References Base Site Rather Than The Localization

    Details

      Description

      Description
      Liferay generates a canonical URL link element for every public page.

      But, the canonical URL that is generated for localized pages point back to the base URL.
      This means that every localized version of a page points back to the base page.

      For example: (Current Behavior)

      Interpretation of Results:
      The current behavior is describing that http://localhost:8080/de_DE/sitename has identical content as http://localhost:8080/sitename

      But, this shouldn't be the case, as the contents of a localized page usually would not have identical content, since it's translated to a different language.

      References:
      https://moz.com/learn/seo/canonicalization
      https://support.google.com/webmasters/answer/139066?hl=en

      Steps to Reproduce

      1. Include the following properties in the portal-ext.properties file:
        locales=en_CA,fr_CA,de_DE,en_US
        locales.enabled=en_CA,fr_CA,de_DE,en_US
        
      1. Startup Liferay
      2. Create a new site with a new page titled "Test"
      3. Sign Out
      4. Navigate to the newly created page and confirm that the inspector output looks something like this:
        <link href="http://localhost:8080/sitename" rel="canonical">
        
      1. Change the language to German by navigating to http://localhost:8080/de_DE/sitename and review the inspector again

      Expected Results:
      The output should read as follows:

      <link href="http://localhost:8080/de/sitename" rel="canonical">

      Actual Results:
      The output reads as follows:

      <link href="http://localhost:8080/sitename" rel="canonical">

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sylvia.luan Sylvia Luan
              Reporter:
              eric.yan Eric Yan
              Participants of an Issue:
              Recent user:
              Liferay JIRA Bot
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                4 years, 7 weeks, 5 days ago

                  Packages

                  Version Package