5

ブラウザに次の同じ URL を入力しても、別のマシンでLiferay 6.1 GA2によって別の URL が生成されています。

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

Machine-1 のブラウザーは以下を生成します。

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

Machine-2 のブラウザーは以下を生成します。

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

言語設定、ローカル設定、ブラウザ設定、コントロール パネル設定など、両方のマシンの構成は同じようです。

誰でもこの理由と、両方のマシンのブラウザに同じ URL を次のようにレンダリングさせる方法を教えてもらえますか?http://my.ip.0.202:8080/web/guest/home

ありがとう

4

1 に答える 1

4

Liferay Wiki:タイムゾーンとロケールの構成を確認しましたか。

私は試していませんが、同僚の1人によると:

2台のマシンでローカリゼーションの不一致がある可能性があります。したがって、1台のマシンでは、「en_GB」が自動的にURLに添付されます。

この問題は、portal-ext.propertiesでプロパティを設定することで解決できます。

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

以下は直接から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

お役に立てれば。

于 2012-10-11T08:45:26.563 に答える