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

Wrong URL's created when having default virtualhost and accessing through hostname different than "localhost"

    Details

      Description

      Steps to reproduce:

      1) Change /etc/hosts (or other files if testing in non-Linux environments) and add a hostname:

      127.0.0.1	mysite.com
      

      2) Enter http://mysite.com:8080 (don't log in yet). At this point, when inspecting html ("head" element) you can see alternate URL are using "localhost" instead of "mysite.com", which is wrong.

      <head> 
      .
      .
      <link href="http://localhost:8080" rel="canonical"> 
      <link href="http://localhost:8080/ca" hreflang="ca-ES" rel="alternate">
      <link href="http://localhost:8080/zh" hreflang="zh-CN" rel="alternate"> 
      <link href="http://localhost:8080/nl" hreflang="nl-NL" rel="alternate"> 
      <link href="http://localhost:8080" hreflang="x-default" rel="alternate"> 
      <link href="http://localhost:8080/en" hreflang="en-US" rel="alternate"> 
      .
      .
      

      3) Log in using "test@liferay.com" user
      4) Go to Site Administration -> Pages.
      5) Add one page and click in "View Pages" -> You are redirected to "http://locahost:8080", which is wrong. You are redirected to the wrong place too when using dockbar "My Sites".

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  5 years, 17 weeks, 2 days ago