Liferay shows different urls for different machines

I see that different URLs are generated by Liferay 6.1 GA2 on different machines, even when I enter the following URL in the browser:

http://my.ip.0.202:8080/ 

Machine-1 browser generates:

 http://my.ip.0.202:8080/en_GB/web/guest/home 

Machine-2 browser generates:

 http://my.ip.0.202:8080/web/guest/home 

The configurations on both machines, such as language settings, local settings, browser settings, control panel settings, seem to be the same.

Can someone tell me the reason for this and how can I get both machine browsers to display the same URL, for example http://my.ip.0.202:8080/web/guest/home

thanks

+4
source share
1 answer

You checked the Liferay Wiki: Configure Time Zones and Locale .

I have not tried, but, according to one of my colleagues:

There may be a localization mismatch with two machines. Therefore, for one machine, "en_GB" is automatically added.

The problem can be solved by setting the property in portal -ext.properties

 locale.prepend.friendly.url.style=0 (by default it is set to 1). 

The following is portal.properties :

 # # Set this to 0 if the locale is not automatically prepended to a URL. This # means that each URL could potentially point to many different languages. # For example, the URL http://localhost:8080/web/guest/home could then be # viewed by users in many different languages. # # Set this to 1 if the locale is automatically prepended to a URL when the # requested locale is not the default locale. This means that each URL # points to just one language. For example, the URL # http://localhost:8080/web/guest/home would point to the default language. # The URL http://localhost:8080/zh/web/guest/home and # http://localhost:8080/zh_CN/web/guest/home would both point to the Chinese # language. # # In cases where the prepended locale is "zh" and not complete locale # "zh_CN", then the full locale returned will be based on the order in which # the locales appear in the property "locales". If "zh_CN" appears before # "zh_TW", then "zh" will be a short hand for "zh_TW". # # The default language is set in system.properties with the properties # "user.country" and "user.language". # # Set this to 2 if the locale is automatically prepended to every URL. This # means that each URL points to just one language. # # Note that each language requires an entry in the property "locales" and a # servlet mapping in web.xml for the I18n Servlet. # locale.prepend.friendly.url.style=1 

Hope this helps.

+3
source

Source: https://habr.com/ru/post/1438837/


All Articles