链接问题

I’m seeing some odd behavior with permalinks on our site. I have a permalink set up to https://support.glitch.com/office-hours which works from a fresh session (in an incognito window, for instance, or even just a new tab) By “works” I mean it returns a 301 redirect to the location configured in /admin/customize/permalinks as I’d expect

I have that link inside a different post on the forum, though, and when that link is followed I get this:

The correct page loads on refresh, but as you might imagine this looks pretty unprofessional to our members. Is there some reason I don’t know about that would prevent that from working?

1 个赞

Permalinks are intended to remap inbound links to your Discourse instance, and are useful when migrating from another platform. They catch inbound traffic and reroute those requests to the new destination, which is why they work when you hit refresh.

They’re not going to work within Discourse itself, please use the correct internal URL, rather than the permalink that you’ve created which redirects to it.

6 个赞

Yes, these are for external URL redirection, there is no concept of internal redirection.

4 个赞

我相信我们现在这里可以实现内部重定向了,对吧 @tshenry

1 个赞

我认为是的。例如,Meta 似乎已将

https://meta.discourse.org/support

设置为指向我们支持类别的永久链接。

目前,我们似乎可以通过以下方式设置永久链接:

1 个赞

感谢大家的回复,各位——我不再管理那个 Discourse 实例了,我们也不再“需要”这个功能,但知道它存在还是挺不错的。

@tshenry 在我看来,你的例子正是上面讨论的“外部”链接,对吧?从外部来源接收请求并重定向到正确的 Discourse URL——我们原本希望实现的效果类似于将 Support - Discourse Meta 重定向到 https://github.com/discourse/discourse/issues(当然,如果你们在那里接受问题报告的话)。我记得对于从外部访问网站的用户来说这可以正常工作,但在从 Discourse 页面点击链接后,首次页面加载时重定向却失败了。

1 个赞

感谢您的澄清!看起来我们确实有一个符合您描述的示例:

https://meta.discourse.org/guide

这似乎按您预期的方式运行吗?

3 个赞

哈哈,我一开始以为你是说那个页面上有一个示例 :wink: —— 一旦我意识到你指的就是那个示例本身,是的,那确实实现了我们想要的效果。谢谢!!

1 个赞

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.