Always show Confluence URL in page ID format
Asked by Daisuke Niwa:

Hello there,

Our customer would like to configure Confluence so it always shows page URL in following format;

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

Currently, when it contains only ASCII letters, the URL looks like

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

but they don't want it.

Any way to achive this requirement? Please let me know.

Regards,

Daisuke Niwa


Answers:
author: RianA
body: Hi Daisuke,

In addition to what Alex said, if you put ASCII character the link will be converted to page ID format. There are also some character that has been reserved by the URL and some characters forbidden in page titles prior to Confluence 4.1, that will be converted to Page ID format. For more information please refer to the following documentation.  
\* https://confluence.atlassian.com/display/CONFKB/Confluence+Page+URL's+Contain+pageId+Instead+of+The+Page+Title  
\* <https://jira.atlassian.com/browse/CONF-2039>

Hope it helps


author: Arya
body: Yeah, this would be a useful feature. It's not really a niche use case at all. A key feature of document management repositories is that every document is assigned a document ID, and users can retrieve that document by ID. I know confluence wasn't designed to compete with products like TRIM, but it's really close - it just needs to allow users to search by page ID, and the page ID needs to be visible on the page.


author: Thomas Beauvais
body: Thank you for the quick response! :)

All of that is great and makes complete sense that it's fancy, human readable and SEO increasing the ability to rank order. The use-case that I am concerned with are problems introduced by changing structure and content titles while rolling it out to users that aren't all that savvy with the platform yet.

It is far more complicated for normal users to understand that they have to go to the Tools menu or press Ctrl+K and then figure out how to paste a link directly into bookmarks instead of doing what they are used to which is either Ctrl+D (which most users don't know about) or just click the "Add to Favorites". They are very frustrated when they bookmark a page and the path is changed because someone simply corrects the title. The title and path aren't intuitively related to the normal users.

Having an administrative check box to "Always display Tiny URL" or "Always display ID based URL" would save a lot of headache and make Confluence more usable for the average user.

If the users are interested in the human readable advantages, then that is great! The default functionality should remain this way. I'm just saying, I've read a lot of threads regarding this topic and it seems like a trivial feature inclusion that would save administrators (like myself) from answering emails "RE: Why are my bookmarks broken.." to which I can only respond with "Your users aren't using Confluence correctly.."

What do you think?

comments: author: Tim Smith
body: Thomas says it perfectly. I would also like this.  


author: Roland Kender
body: Me also would like this option.


author: Dheeraj Gupta
body: Yes, it is one of the most required options.

If this is implemented we can even program where to redirect the user, from GUI.

This title-based URL causes many problems when there is a change in the content


author: Nic Brough -Adaptavist-
body: It's not going to happen, I had this discussion with an Atlassian last year. The best you're going to get is the use of the tinyurl option.


author: Thomas Beauvais
body: Coming from a technical background, this sounds crazy to me.

We are looking to migrate to Confluence for our documentation needs but it is unclear where everything will reside in the Confluence structure or what titles the pages will have. This "human readable" feature breaks bookmarks, links and emails during the movement period.

It is crazy that renaming the content page would break someone with a bookmark.

Since there is a fallback case for the l18n standard and uncodable characters such as punctuation, it wouldn't be that difficult to provide administrators (like myself) with the power to switch to the ?pageId=XXXX. Thus providing the stability for users to change the names and move content around as they see fit.

comments: author: twong_atlassian
body: The functionality that you wish for already exists: you can already share a tiny link of your page, which is stable regardless of title change or location change. Tiny links are available by either using Tools\>Link to this Page or by hitting k whilst viewing your page. The tiny url field is selected for your convenience such that you can hit k and then control-c.

Furthermore, you can always use domain.com/pages/viewpage.action?pageid=12345, if you know the pageid. It requires some foreknowledge that you can mouse over the edit link to find the pageID, but it is valid.

The reason for using the human readable urls whenever possible are manyfold:

1. Humans can read them.

2. SEO: keywords increase ranking order.


author: David Luke
body: We want the *option* to display the "pageid" URL in the browser's URL bar.


author: Dheeraj Gupta
body: Hi David Luke,

To get the Page Id in URL, you can view the target page in edit mode, copy the URL, and change the "**++*edit*++page.action"?pageId=\<your page id\>** to **++*view*++page.action"?pageId=\<your page id\>**.

This URL will also keep your links unbroken, even when the page title changes.

I hope, this helps.

Regards,

@Dheeraj Gupta


author: Nic Brough -Adaptavist-
body: That's not what was being asked, and has been discussed before.

A better option is also to use the tiny url, and, more importantly, when inserting links to confluence pages, to use the internal link format (of space and page name) as that follows the pages when they're moved and renamed.


author: twong_atlassian
body: Hi Daisuke:

I've created you a jira request here:

<https://jira.atlassian.com/browse/CONF-27966>

I also submitted a working patch for confluence 4.3.6. This is untested in the large scale, but tested in the small scale.

Tim

comments: author: Daisuke Niwa
body: Tim,

Thanks for your great help!

Regards,

Daisuke Niwa


author: Nic Brough -Adaptavist-
body: Not really. Confluence serves up it's page names in a human-friendly view where it can. You would need to do some significant coding in the core of Confluence to tell it to be less friendly, or try to rewrite any outgoing urls as they go out through Apache (or other web server)

comments: author: Daisuke Niwa
body: Nic,

Is it possible for you to give a rough idea about " rewrite any outgoing urls as they go out through Apache" part?

Thanks.

<br />


author: Daisuke Niwa
body: Thanks! Will have a look at it.


author: Nic Brough -Adaptavist-
body: <http://httpd.apache.org/docs/2.2/rewrite/>


author: Gustavo Santos
body: Hi,

There is a way to do it. You need to disable the atlassian pretty urls plugin.

See more here:

* <https://answers.atlassian.com/questions/321381>

comments: author: Tim_ Smith
body: I just tried disabling this on my 5.4.2 instance and it had no effect on existing or newly created pages. Tired restarting the software and re-testing...still nothing. Any trick to this?


author: John Pisani
body: Hi Tim,The reason is that links back to Confluence placed in our external systems have the risk of breaking when someone reconsiders how the target article is named.As I think I mentioned in the Jira comments, I know this can be done by grabbing the tiny URL from the info page bit that's a bit more complex for my wider user base and we're trying to drive adoption

comments: author: twong_atlassian
body: Well, you could do the above (implement my patch), or you could do something a little less impactful.

You could distribute a bookmarklet that does something like this:

```
javascript:(function(){window.location=AJS.$('#editPageLink').attr('href').replace('edit','view') ; })();
```

That would mean someone could click their bookmark in browser, and it would change the page automatically to the viewpage style. Or, you could inject a button on your own using some jquery to the page. Or you could make the bookmarklet automagically copy a linky to their clipboard (this is easier said than done, as there isn't a great way to do this w/o flash).

Lots of possibilities exist.


author: John Pisani
body: If we can in anyway +1 this for mainstream release, it would be very helpful to the way we do things

comments: author: twong_atlassian
body: I'm afraid that probably won't happen. This is kind of a niche use case. Out of curiosity, why would doing it by ID be better for your usecase?


author: Daisuke Niwa
body: Hello Tim,

It's Confluence 4.3.6


author: twong_atlassian
body: What version?


author: Alejandro Conde Carrillo
body: As a workaround, you could include a non ascii character in all page titles to force Confluence to use the id instead of the page title.