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

Locales are doubled in canonical URLs with multiple virtual hosts and using the property locale.prepend.friendly.url.style=2

    Details

      Description

      Reproduction Steps:

      locale.prepend.friendly.url.style=2

      into the portal-ext.properties file, and the default language is English and the available language is French.

      • Go to Site Builder --> Pages and add a public page "test" and configure a friendly URL for the French language (for example, /gate)
      • Go to Configuration --> Site Settings --> General and under SITE URL add 2 virtual hosts (make sure to add these in your hosts' file). I added them as follows:
        a. www.test.test.com for the default language
        then click on "+" to add another virtual host:
        b. www.dev.test.com for the French language.
      • - In a different tab I entered www.test.test.com:8080 and clicked on the test page "http://www.test.test.com:8080/en/test", then right-click on mouse "View page source"
        Checkpoint:
      <link data-senna-track="temporary" href="http://www.test.test.com:8080/en/test" rel="canonical" />
       <link data-senna-track="temporary" href="http://www.test.test.com:8080/fr/gate" hreflang="fr-FR" rel="alternate" />
       <link data-senna-track="temporary" href="http://www.test.test.com:8080/en/test" hreflang="en-US" rel="alternate" />
       <link data-senna-track="temporary" href="http://www.test.test.com:8080/en/test" hreflang="x-default" rel="alternate" />

      The canonical URLs are alright and pointing to the URL correctly according to the locale.

      • In another tab, enter www.dev.test.com and click the gate page "http://www.dev.test.com:8080/gate", then View page source.

      Actual Result:

      <link data-senna-track="temporary" href="http://www.dev.test.com:8080/en/test" rel="canonical" />
       <link data-senna-track="temporary" href="http://www.dev.test.com:8080/en/test/fr/" hreflang="fr-FR" rel="alternate" />
       <link data-senna-track="temporary" href="http://www.dev.test.com:8080/en/test/en/" hreflang="en-US" rel="alternate" />
       <link data-senna-track="temporary" href="http://www.dev.test.com:8080/en/test/en/" hreflang="x-default" rel="alternate" />

      The canonical URLs locales are doubled and pointing to the test URL

      Expected Result: The canonical URLs should not be doubled and should point correctly to the page URL according to the locale as with the first virtual host.

        Attachments

          Activity

            People

            Assignee:
            yvonne.han Yvonne Han
            Reporter:
            attila.bakay Attila Bakay
            Participants of an Issue:
            Recent user:
            Enterprise Release HU
            Engineering Assignee:
            Attila Bakay
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              6 weeks, 2 days ago

                Packages

                Version Package
                7.3.X
                7.4.13 DXP GA1
                7.4.3.4 CE GA4
                Master