問題
-
仮想ホストが構成されている場合、サイト URL から /web/guest を削除することはできません。 /web/guest なしでアクセスすると、ページが読み込まれ続け、ログに 404 エラーが表示されます。
Environment
- Liferay DXP 7.3
解決策
- この動作は、ユーザーが次のプロパティを false に設定した場合に発生する可能性があります。 portal-ext.properties ファイル で次のプロパティを削除するか true に設定する必要があります。
com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter=false
- 同様に、これが機能する場合があるため、次のプロパティを追加します。
#
# Specify the site name that will default to the company's virtual host.
# If the specified site has a virtual host, then that will take precedence.
# If it does not, then it will use the company's virtual host. This property
# is useful to remove "/web/guest" (or any other site) from the default URL.
# For example, if this property is not set, then the default URL may be
# http://localhost:8080/web/guest/home. If this property is set, then the
# default URL may be http://localhost:8080/home.
#
virtual.hosts.default.site.name=Guest
追加情報
- プロパティを変更する前に、アプリケーション サーバーを停止してください。
1) 実行中のアプリケーションを停止します。
2) 上記のプロパティを portal-ext.properties ファイルに追加します。
3) すべての一時フォルダーをクリアするclear osgi/state
4) アプリケーションを再起動します
clear {liferay_home}/work
clear {liferay_home}/tomcat/temp
clear {liferay_home}/tomcat/work - portal-ext.properties ファイルが変更されるたびに、サーバーを再起動する必要があることに注意してください。変更は再起動後にのみ反映されるためです。