0

confluence-3.2.1_0
如何在 Atlassian Confluence 中出现 404 错误时重定向到新页面(在当前空间中创建页面)?

我想我需要更改 web.xml 中的操作:

    <error-page>
    <error-code>404</error-code>
    <location>/fourohfour.action</location>
    </error-page>

类似于:

    <error-page>
    <error-code>404</error-code>
    <location>/createpage.action</location>
    </error-page>
4

3 回答 3

1

/pages/createpage-entervariables.action?spaceKey=KEY

但你没有钥匙,所以我认为你有问题

于 2011-12-13T23:18:20.930 回答
0

此处列出的步骤中,您可以更新链接,而不是更新 404 页面,这样如果页面存在,用户就会被重定向到那里,否则他们可以创建页面。

链接的样式-

http://xxxxx/pages/createpage.action?spaceKey=experiment&title=this+does+not+exist&linkCreation=true&fromPageId=623770
于 2012-11-15T02:41:55.203 回答
0

虽然我的答案有点不同,(没有创建页面,我只是重定向到主空间),就是这样。非常简单,可以根据您的需要量身定制。

注意:404.vm 是fourohfour.action 所调用的。只需保留 web.xml 并编辑 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>
于 2016-10-01T20:33:35.583 回答