# 断链会重定向到“拒绝访问”页面而不是404页面

**URL:** <https://meta.discourse.org/t/broken-links-redirect-to-the-access-denied-page-instead-of-404/346619>\
**Category:** Bug\
**Created:** [2025年一月11日 05:14 UTC](https://meta.discourse.org/t/broken-links-redirect-to-the-access-denied-page-instead-of-404/346619 "2025-01-11T05:14:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)\
**Post date:** [2025年一月11日 05:14 UTC](https://meta.discourse.org/t/broken-links-redirect-to-the-access-denied-page-instead-of-404/346619/1 "2025-01-11T05:14:14Z")

</div>

访问错误的帖子 URL，例如 [https://meta.discourse.org/t/modifying-style-attribute-dynamically-on](https://meta.discourse.org/t/modifying-style-attribute-dynamically-on) -topic-list-item/346415/2（注意空格），会导致以下问题：

 ![A web page displaying an access denied message with a yellow circle and a red circle on a blue background. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/8/4/6/8469c1dd3f1aafc61b3807e4e9af04b16658af95.png)

重新加载后，会发生这种情况：

 ![An error message indicates that the page does not exist or is private on a website. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/1/2/f/12f63adfa7971f730fbb5ac1300554a17124ae19.png)

链接应该直接跳转到第二个图像中显示的页面，而不是第一个图像中显示的页面。  
@merefield 和我都注意到在 [Many pages unindexed by Google](https://meta.discourse.org/t/any-advice-on-how-to-find-experienced-discourse-developers/345965) 上发生了这种情况。 \[1\]

* * *

1. 别担心，那个超链接没有坏 😆

---

<div class="post-metadata">

**Author:** ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)\
**Post date:** [2025年四月15日 21:54 UTC](https://meta.discourse.org/t/broken-links-redirect-to-the-access-denied-page-instead-of-404/346619/2 "2025-04-15T21:54:38Z")

</div>

这是元问题还是 Discourse 软件本身的问题？您现在仍然可以重现吗？

---

<div class="post-metadata">

**Author:** ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)\
**Post date:** [2025年四月15日 23:56 UTC](https://meta.discourse.org/t/broken-links-redirect-to-the-access-denied-page-instead-of-404/346619/3 "2025-04-15T23:56:02Z")

</div>

> [@tobiaseigen](#):
>
> 这是元问题还是 Discourse 软件本身的问题？

我仍然可以在 Theme Creator 中重现此问题。

* * *

> [@tobiaseigen](#):
>
> 你现在仍然能够重现它吗？

我在主题中发布的链接仍然指向那个页面，甚至是以下链接：  
正确链接：

> [@Discourse Data Explorer](https://meta.discourse.org/t/discourse-data-explorer/32566/290):
>
> If i share a SQL query with the moderator’s group, how can the users in moderator group run the query from their account? They cant see the [Data Explorer](https://meta.discourse.org/t/32566?silent=true) plugin

损坏的链接：  
[https://meta.discourse.org/t/discourse-data-e](https://meta.discourse.org/t/discourse-data-e) xplorer/32566/290
