How to enable links for non-logged in Confluence users?

I use Confluence for a subscription-based web site, and at present if users aren't logged in any links to subscriber content are disabled. This is sometimes confusing for my non-logged in users. I would like to enable the links at all times so the users are prompted to log in when necessary. Is this possible?



2 answers

1 accepted

While not the idea solution, the following is the best option I've come up with so far. I added the following Javascript in Custom HTML at the end of the page. It looks for URLs that end in # (Confluence's convention for hiding inaccessible URLs) and replaces them with one of two publicly-accessible pages on my site, depending on whether or not the user is logged in.

<script type="text/javascript">
AJS.toInit(function ($) {
        for (var ls = document.links, numLinks = ls.length, i=0; i<numLinks; i++){
            if (!!ls){
	        var l = ls[i].href;
                if (l.indexOf("#") + 1 == l.length){
                    if (AJS.params.remoteUser == ''){
                        ls[i].href= "insert login-required URL here";
                    } else {
                        ls[i].href= "insert not-covered-by-subscription URL here";

Hi Dave,

I believe you can achieve that by enabling a space to be accessed by anonymous users.

In order to set a space to be accessible by anonymous user, you need to login as confluence admin, then click on Space Tool > Permission. In Anonymous access section you click on Edit Permissions and then you can select the permission as required.

Or if you want your whole site to be accessible by anonymous users you can set your Confluence to do so too.

You might find the following document usefull:

Hope it helps.

Ah, but that's just the problem. I don't want subscriber-only spaces to be accessible by anonymous users, but I want anonymous users to see real links so that when they click on those links they're prompted to log in.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

606 views 20 11
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you