Non-Unique Page Names & URL Rules
Asked by Nathan Farrar:

I'd like to do the following:  
* Be able to have pages with the same names.
* Modify the way that the page URLs work, specifically:
  * Make the URLS for pages reflect the full path to the page (see below).
  * Make all URLS lowercase.
  * Replace spaces in page names with dashes (see below).
  * Specify (in some cases) a value that should be used for the last part of the page url, rather than the name.

Here's a basic example of why I want to do this:

I organize my wiki into sections. So, for example with my 'home' wiki - I have several "root" sections, but for this example, only the following two are relevant:

* Projects - This *section* contains *sub-sections* that contain project pages. The *sub-sections* are things like *Automation* and *Networking*.
* Products - This *section* contains *sub-sections* that contain product pages. The *sub-sections* are things like *Automation* and *Networking*.

Using the default behavior, the hierarchy and urls look like this:

* Home ? Projects ? Automation Projects ? Project 01: https://url/wiki/display/home/Project+01
* Home ? Projects ? Networking Projects ? Project 02: https://url/wiki/display/home/Project+02
* Home ? Products ? Automation Products ? Product 01: https://url/wiki/display/home/Product+01
* Home ? Products ? Networking Products ? Product 02: https://url/wiki/display/home/Product+02

The way I set organize my wikis, this is very limiting. It forces me to name pages to work around the unique naming restriction and it doesn't reflect *where* the user is in the wiki.

For my structure, it would be much, much better to have something like:

* Home ? Projects ? Automation ? Project 01: https://url/wiki/display/home/projects/automation/01
* Home ? Projects ? Networking ? Project 02: https://url/wiki/display/home/projects/networking/02
* Home ? Products ? Automation ? Product 01: https://url/wiki/display/home/products/automation/01
* Home ? Products ? Networking ? Product 02: https://url/wiki/display/home/projucts/automation/02

This would allow me to use shorter, more concise names. It also makes it obvious *where* in the wiki structure the user is currently located.

I'm currently using a hosted instance, but have some new servers I'm installing this week and plan to very shortly move to a self-hosted setup.

Is doing something like this possible? Has anyone done it, have any advice?

* With a self-hosted wiki, is it possible through configuration options?
* Are there any plugins that already exist that could do this?
* If I took the time to write my own plugin, could I accomplish something like this?
* Could I use a specialized/customized proxy (apache, nginx, etc) configuration to rewrite the URLs to do something like this?


Answers:
author: Rob Woodgate
body: To add to what Nic is (correctly) saying, you're essentially doing the same thing as asking if you can have the same value in more than one row in a primary key column in a database. I'm not sure of the internal database structure of Confluence, but Atlassian have never allowed duplicate page titles in a space, and it seems likely that this is as much a hard database limit as a design decision.


author: Nic Brough -Adaptavist-
body: In Confluence, a page name has to be unique in a given space. So, the short answer is "no"

There are some add-ons which allow you to fake duplicate names, sort of, but I don't think any of them support the structures you've defined here - they're aimed at different things. Have a look at Scroll Versions and Viewport (and check the rest of the marketplace, those are just the two I've used that might be helpful)


Tags: confluence-administration