Atlassian Confluence - 在 404 错误上重定向到新页面

发布于 2024-12-21 05:30:38 字数 475 浏览 4 评论 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>

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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

冬天旳寂寞 2024-12-28 05:30:38

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

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

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

but you don't have the key so I think you have a problem

缘字诀 2024-12-28 05:30:38

来自 此处列出的步骤,您可以更新链接,而不是更新 404 页面,以便如果该页面存在,用户将被重定向到那里,否则他们能够创建页面。

链接的样式是-

http://xxxxx/pages/createpage.action?spaceKey=experiment&title=this+does+not+exist&linkCreation=true&fromPageId=623770

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
他夏了夏天 2024-12-28 05:30:38

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

注意: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>

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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文