How to force pretty URLs in Confluence?
Asked by Marcel_R__Ackermann:

Hi. When using confluence, I find that pages on the top level of a space do always have "pretty" human-readable URLs, like
> <http://confluence.mydomain.org:8090/display/KEY/Page+Title+Goes+Here>

However, pages on the second level and below are always references by a cryptic page id, e.g.
> <http://confluence.mydomain.org:8090/pages/viewpage.action?pageId=12345>

Is there a configuration option where I can tell Confluence to use pretty URLs for each and every page? I know that there is a "tiny" URL for each page, but they are also very cryptic.

Many thanks in advance.


Answers:
author: Amalia
body: Please refer to the following KB for more info: https://confluence.atlassian.com/display/CONFKB/Confluence+Page+URL's+Contain+pageId+Instead+of+The+Page+Title

There's actually a feature request for that: <https://jira.atlassian.com/browse/CONF-11285>

Unfortunately, I am not aware of any workarounds for this as of now. FYI, this has affected our FAQ as well, for example: <https://confluence.atlassian.com/pages/viewpage.action?pageId=152044582>

One of FAQ pages that is not using a question mark: <https://confluence.atlassian.com/display/CONFKB/How+To+Create+a+Maintenance+Splash+Page>. It uses "How To" instead of "How Do .... ?". Perhaps this could be an option?

comments: author: Marcel_R__Ackermann
body: Thanks for your answer. Unfortounately, the questions are fixed, so changing them to avoid this shortcoming is not an option.

Frankly, looking at the feature request, it is a little bit discouraging too see that small but reasonable feature requests like these are unresolved for more than four years, while new versions and new features are introduced at an ever faster pace.


author: Robert Lauriston
body: I've opened a feature request for improving the way bug fixes are scheduled:

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


author: James Lenoel
body: Anyone visiting this page, the link @Amalia Sanusi helpfully includes has had a name change. It's now called:

<https://confluence.atlassian.com/confkb/confluence-page-urls-contain-pageid-instead-of-the-page-title-278692715.html>


author: Marcel_R__Ackermann
body: Ok, I just found this question [https://answers.atlassian.com/questions/87181/nice-urls-only-on-some-confluence-ondemand-pages](/questions/87181/nice-urls-only-on-some-confluence-ondemand-pages) which is at least in part a duplicate. It seems, thatz special characters (in my case a question mark) lead to the ugly URLS. However, the question remains, whether there is way to force Confluence to use pretty URLs and maybe replace any special character by somethin else?


author: JamieA
body: I don't see that - which version of confluence?

If you use certain characters in the title then you get the pageId, eg colon, semi-colon I think, otherwise you should get a sensible title.

Are you using any plugins? Eg scroll versions - not attempting to cast aspersions here, but I know that it supports multiple pages per space with the same title, so perhaps it gets round that using the pageId (alternately it may just put the version number in the url).

comments: author: Marcel_R__Ackermann
body: Hi Jamie. I am using Confluence 4.2.2.

I am using a pretty fresh installation and have only installed one or two plugins. However, there are a number of plugins listed of which I assume that they have been installed with the distribution (unless our admin has been active without telling me): Advanced Macros, Basic Macros, Code Macro Plugin, Confluence Attachments Plugin,Confluence HTML Macros, Dynamic Task List 2 Plugin, Google Maps Plugin, IM Presence NG Plugin, JIRA Macros, Support Tools Plugin, Tabular Metadata, Widget Connector

My problem really seems to come from the characters in the title. I am writing F.A.Q. pages, so essentially each title contains a question mark (and apostrophes are quite frequent). When I remove them, the pretty URLs appear. However removing the punctuation is not an option.

So my question would be: How to force pretty URLs in the presence of "evil" characters?


author: Dean McGinn
body: Hey,

You can use scroll viewports which would enable you to manually decide if you want hierarchical or flat naming convention. It will also mean that you will never see a pesky "viewpage.action" link anymore.

We use Viewport for our customer facing Confluence space.

What's best about the Scroll Viewport add-on, is that you get to customise the them seperately to you confluence VM (Velocity macro template file).

This inlcudes a bunch of useful tools and utilities you can harness to do other work, for example, conditional page content, sometimes it's better to not render the HTML at all if the user cannot view it.


author: Alexander Klimetschek
body: Confluence should really support nicer URLs that can be remembered by humans (e.g. if someone enters a link in a presentation). Special characters forcing the ugly URL is a no go, using the noisy "+" instead of "-" as placeholder for spaces, as well as having 3 different ways to address a page (1. normal: display/KEY/PAGE 2. pages/viewpage.action?spaceKey=...title=... 3. pages/viewpage.action?pageId=). "display" and "pages"). It should encourage people creating a page to provide a simple URL name and not just take any arbitrary long title text. Github markdowns id generator for headings is a good way for automating that (but still users should be able to customize it). And then support URLs where the space is a subdomain and just the short name is used as path: myspace.confluence.mydomain.org/some-nice-page


author: Marcel_R__Ackermann
body: Updated the title to reflect the question better.


Tags: url