Adding "create this page" link on "Page not found" pages

We have an existing internal utility that automatically creates links to additional information about all of our servers, of the form . If this page pre-exists, everything is fine. If this page does not exist, we are given a default 'Page not found' page, and not given an option to create it. We would like to be able to add content to this URLs on-demand. Is this possible?

1 answer

Hi Jeff:

Was an interesting problem.

You can alter the 404.vm velocity file that controls the 404 page in confluence. You can create a page on confluence by simply hitting http://yourinstance/pages/createpage.action?spaceKey=SOMEKEY&title=SOMETITLE

As such, I was thinking of just adding a link to 404.vm which gets shown on a page not found that reads the missing title and constructs a url as mentioned above.

Easy enough right? Well, this is where I ran into a wall. One of the features of Confluence is that we will search for analogues of your page title before returning 404, so that if you wanted a page like 'hoem' it might find the 'home' page in your space. You can usually figure out what page you're on or what url got you to a particular location using some of the objects in Hoewver, because we direct you first to the PageNotFoundAction then to the FourOhFourAction upon failure to find mispellings, we lose the original title/request url.

Lame. You could hard code the right space.... but then you'd still have to type in a title (if you omit the &title part of the url, it'll just be "new page")

Of course, you could muck with, and change the behavior of the whole thing... but thats a rather large change.

Meh... not a great answer for it, but this is where I drew the line and gave up.

Suggest an answer

Log in or Join to answer
Community showcase
Maarten Cautreels
Posted Thursday in Off-topic

Friday Fun: What's your favourite beer/drink

As a Belgian, beer-lover and home brewer, beer is one of my great passions. I love the fact that with just a few ingredients (usually just water, hop and malt) you can create so many different tastes...

298 views 38 9
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot