How to properly redirect pages in Confluence?

Sorin Sbarnea (Citrix)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 13, 2013

I have several pages that were merged into a single one but people with bookmarks to the old pages are not redirected.

How do I redirect from one URL to another in Confluence?

Now: people do see the "Page Deleted" page.

3 answers

1 accepted

4 votes
Answer accepted
AlysonA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 13, 2013

Hi Sorin,

In terms of plugins solution, you can refer to the following ones:

Both of the above plugins will help you managing page redirection. Just be sure to check whether the above plugins are compatible with the Confluence version you're running.

Hope it helps!

Sorin Sbarnea (Citrix)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 14, 2013

I picked the Customware one, as it seems to work with most Confluence versions.

AKASH BHARDWAJ July 13, 2014

I have Confluence 5.2.5 version, Can anyone please help me how to Redirect from old space to new Space. I have old space with contents but now i have merged those contents to new space, people visiting the old space and its pages should be redirected to new space.

Please let me know how can i achieve this.

Thanks & Regards,

Akash

2 votes
Steve April 28, 2021

We were struggling to redirect Confluence pages, there was nothing that worked for us on the marketplace, so we decided to build something for ourselves. It works so well we just put it on the marketplace as Easy Redirection for Confluence cloud.

If you're planning a move to the cloud it might help, it's cloud only.

1 vote
Bernd Schneider October 13, 2020

Does this plugin also work with ScrollVersions (from k15t)?

David (K15t) October 14, 2020

Hi Bernd,

the way those apps are functioning, they should be working just fine with Scroll Versions, provided the user has all the correct permissions.

Depending on the exact case, it might also be a good idea to redirect to change pages directly.

Cheers,

David

Like Bernd Schneider likes this
Bernd Schneider October 15, 2020

Thanks, David!

The exact case is: If I have a page under version control, say page A. And I have a page in the same space, say B. I want to redirect a request for B to be redirected to A - especially without the need to specify the version (in a ScrollVersions space everything should refer to the version selected by the user.

So the user selected to work with version X: page B in version X shall be redirected to page A in version X

User changes to version Y: now page B in version Y shall be redirected to page A in version Y - without specifying the version in the redirect macro which would spoil the version sensitivity.

Does this work?

David (K15t) October 16, 2020

Hi Bernd,

unfortunately, I don't think those macros can be made version-sensitive easily. 

You are correct about the general premise of every link usually linking within the currently selected version, despite the actual link pointing toward the master page. That is achieved by Scroll Versions by detecting and changing all the page links when viewing a Confluence page.

The macros from the apps above seem to have a fixed URL or page link that aren't picked up by Scroll Versions' link fixer. This means, you'd have to configure the redirect individually for every version.

If you're looking for simple redirect functionality, it's probably easier to just create a user macro that also displays the link on the page, allowing it to get fixed using Scroll Versions' link fixer.

Here's something I quickly threw together as a PoC:

Screen Shot 2020-10-16 at 09.31.08.png

Here's the code within the macro definition:

## @noparams

<div class="confluence-information-macro confluence-information-macro-note conf-macro output-block" data-hasbody="true" data-macro-name="scroll-versions-redirect">
<span class="aui-icon aui-icon-small aui-iconfont-warning confluence-information-macro-icon"> </span>
<div class="confluence-information-macro-body scroll-versions-redirect-macro">
$body
</div>
</div>

<script>
setTimeout(function(){
window.location.href = $(".scroll-versions-redirect-macro a").attr("href");
}, 3000);
</script>

This macro looks and functions like the Confluence note macro, but also redirects you to the link in its body after 3 seconds. Since the link is on the page, it should be version-sensitive. You'd just need to make sure there is exactly one link in the body of the macro, otherwise strange things might happen.

Let me know what you think.

Cheers,

David

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events