legacy-knowledge-base
公開されました Jun. 30, 2025

存在しないjpgやgifを呼び出した場合の動作の違い

written-by

Tímea Bihari

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

問題

  • 存在しないファイルをドキュメントパスで開こうとした。
  • 例:localhost:8080/documents/abc.jpgまたはlocalhost:8080/documents/abc.gif
  • ユーザーは "Not Found "ページを取得しますが、2つの拡張機能で同じではありません。

環境

  • Liferay DXP 7.4+

解像度

異なる動作は以下のプロパティに由来する(以下はプロパティのデフォルト値):

#
# Set the extensions that will be ignored for virtual hosts.
#
# Env: LIFERAY_VIRTUAL_PERIOD_HOSTS_PERIOD_IGNORE_PERIOD_EXTENSIONS
#
virtual.hosts.ignore.extensions=\
.css,\
.gif,\
.image/company_logo,\
.ico,\
.js,\
.jpeg,\
.jsp,\
.png,\
/portal/layout,\
/portal/login,\
/portal/logout


gif拡張子はリストに追加されるが、jpgは追加されない(jpegのみ)。 jpgも追加すれば、両方の拡張機能で同じ動作を実現できる。

追加情報

このプロパティの機能については、以下の記事で説明しています:URLにweb/guest部分が含まれていない場合、特定の拡張子を持つURLのリダイレクトは不可能です。

did-this-article-resolve-your-issue

legacy-knowledge-base