How to prevent 404 pages from redirecting unauthenticated users to the login screen

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

目的

If anonymous access is not enabled in your site (people need to be logged in to use Confluence), unauthenticated users will always be redirected to the login screen, even if the URL they've tried to access does not exist. We only show a 404 page not found page if the user is logged in.

There are a few rare situations where you may want to display a 404 page not found page, without requiring the user to be logged in, for example if you have an integration or third-party plugin that relies on displaying the 404 page.

ソリューション

In this situation you can specify particular URLs to be exempt from this behaviour. Note that you can't exempt page or blog URLs (/display/SPACEKEY/page+title). 

This is available in Confluence 7.5.2 and later.

To exempt particular URLs:

  1. Create a file called 404-login-exemption.properties.
  2. Add the URL paths to be exempted as follows. You don't need to include your base URL or context path. Add new lines if you want to exempt multiple URLs. 

    fourohfour.allow.url.without.login=/mypath
    fourohfour.allow.url.without.login=/plugins/servlet/myplugin
  3. Save the file, and place it in the <home-directory>/shared-home/config directory. 
    If you run Confluence in a cluster, place it in the <shared-home>/config directory. 

  4. Confluence を再起動します。

You need to restart Confluence for any changes to this file to take effect. 


最終更新日 2020 年 6 月 22 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.