# 通过路由重定向内部链接

**URL:** https://meta.discourse.org/t/redirecting-internal-links-via-routes/236019
**Category:** Support
**Created:** [2022年八月12日 18:19 UTC](https://meta.discourse.org/t/redirecting-internal-links-via-routes/236019 "2022-08-12T18:19:54Z")
**Posts on this page:** 1
**Showing post:** 9

<div class="post-metadata">

### Author: ![attj](https://avatars.discourse-cdn.com/v4/letter/a/a698b9/32.png) [@attj](https://meta.discourse.org/u/attj)
#### Post date: [2022年八月17日 15:27 UTC](https://meta.discourse.org/t/redirecting-internal-links-via-routes/236019/9 "2022-08-17T15:27:33Z")

</div>

在您提到主题组件后，我使用以下组件部分地完成了我想要的功能：[Auto-Linkify Words](https://meta.discourse.org/t/linkify-words-in-post/82193)

它完美支持正则表达式，因此每当有人输入 [mywebsite.com&nbsp;-&nbsp;This website is for sale!&nbsp;-&nbsp;mywebsite Resources and Information.](http://mywebsite.com/123/456) 时，它都会成功地将链接替换为 [mywebsite.com&nbsp;-&nbsp;This website is for sale!&nbsp;-&nbsp;mywebsite Resources and Information.](https://mywebsite.com/tag/123-456%E3%80%82)

唯一剩下的问题是，如果有人输入带有前缀 https:// 的网址，它就无法正常工作。不过，它仍然是一个非常好的组件。

---

_[View the full topic](https://meta.discourse.org/t/redirecting-internal-links-via-routes/236019)._
