Change Confluence URL Default to use Page ID

Omar Hafez November 24, 2019

Hi there,

 

We would would like to configure Confluence so that it always shows page URL in following format: 

<Confluence Base URL>/pages/viewpage.action?pageid=<pageid>

 

Currently it displays in the following format: 

<Confluence Base URL>/display/<Space Key>/<Page Title>

 

Someone posted the same question over 5 years ago here on the forums.

I'm hoping there's a solution for this now?

Any help/guidance would be much appreciated. 

 

Thank you

 

4 answers

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 29, 2019

It is not possible to disable the "pretty" urls without code change.  See https://jira.atlassian.com/browse/CONFSERVER-52113 for the request.

You can get at the id though.  If you write a new "user macro", it can be really short:

## @noparams
$content.getId().toString()

(This is from memory, it might not be quite right, and it is very plain, you literally just get the content ID and nothing else)

0 votes
Omar Hafez November 27, 2019

Hi, 

I still haven't found the answer I'm looking for. Anyone else able to weigh in? 

0 votes
Omar Hafez November 24, 2019

@Kiran Panduga {Appfire} Thanks for the quick response!

I would imagine it would be relatively difficult to enforce this kind of practice across an entire organisation, is there no way other way to have Page ID URL as the default (without the conditions)? I've used confluence in other organisations in the past that have setup a macro of some sort that displays the Page ID on the page, and when clicked on, refreshes the page, except now with the Page ID URL format.  

Do you know how this is done? 

0 votes
Kiran Panduga {Appfire}
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 24, 2019

Hi @Omar Hafez 

 The Confluence URL format is based on the page title, there are conditions in which can prevent the pretty format from being generated. These conditions include:

  • If the page title contains a URL reserved or unsafe character, such as:

    % & ? / \ ; " § +
  • Or, if the final character of the page title is of any non-alphanumeric character

If either of these are true, Confluence will default to using the pageId URL format instead of trying to generate a pretty URL with the page title.

In your case, you will have to use any special character in the title of the page, then only the URL format can be in pageID format.

i.e

https://confluence.example.com/pages/viewpage.action?pageId=123456

For more information, please visit this KB.

https://confluence.atlassian.com/confkb/the-differences-between-various-url-formats-for-a-confluence-page-278692715.html

thanks,

Kiran.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events