Reputation: 23
confluence-3.2.1_0
How to make a redirect to a new page(create page in current space) on 404 Error in Atlassian Confluence?
I think I need to change action in web.xml:
<error-page>
<error-code>404</error-code>
<location>/fourohfour.action</location>
</error-page>
To something like:
<error-page>
<error-code>404</error-code>
<location>/createpage.action</location>
</error-page>
Upvotes: 0
Views: 1807
Reputation: 2791
While my answers a bit different, (no create page, I just redirect to main SPACE), here is it. Very Simple and could possible be tailored for what you want.
Note: 404.vm is what is called by fourohfour.action. Just leave web.xml alone and edit 404.vm!
sudo mv /opt/atlassian/confluence/confluence/404.vm /opt/atlassian/confluence/confluence/404.vm.original
sudo nano /opt/atlassian/confluence/confluence/404.vm
<!DOCTYPE HTML>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1; url=http://example.com/url">
<script>
window.location.href = "http://example.com/url"
</script>
<title>Page Redirection</title>
<!-- Note: don't tell people to `click` the link, just tell them that it is a link. -->
If you are not redirected automatically, follow the <a href='link'>http://example/url'>link to example</a>
Upvotes: 0
Reputation: 2232
From the steps listed here, instead of updating the 404 page you could update your links so that if the page exists, the user is redirected there, otherwise they are able to create the page.
The links are of the style-
http://xxxxx/pages/createpage.action?spaceKey=experiment&title=this+does+not+exist&linkCreation=true&fromPageId=623770
Upvotes: 0
Reputation: 701
/pages/createpage-entervariables.action?spaceKey=KEY
but you don't have the key so I think you have a problem
Upvotes: 1