# Discourse 网站路径 URL 重命名

**URL:** <https://meta.discourse.org/t/discourse-website-path-urls-rename/221636>\
**Category:** Development\
**Created:** [2022年三月22日 07:42 UTC](https://meta.discourse.org/t/discourse-website-path-urls-rename/221636 "2022-03-22T07:42:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hemant\_Raju1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hemant_raju1/32/249206_2.png) [@Hemant\_Raju1](https://meta.discourse.org/u/Hemant_Raju1)\
**Post date:** [2022年三月22日 07:42 UTC](https://meta.discourse.org/t/discourse-website-path-urls-rename/221636/1 "2022-03-22T07:42:03Z")

</div>

我想重命名一些路径 URL  
例如：[http://localhost:4200/c/biotechnology/5/l/calendar](http://localhost:4200/c/biotechnology/5/l/calendar)  
我希望将 calendar 重命名为 events。

[http://localhost:4200/agenda](http://localhost:4200/agenda)  
我希望将 agenda 重命名为 calendar

你能告诉我该怎么做吗？我可以通过网站管理员面板进行操作吗？  
或者需要通过代码来完成？

如果需要在后端完成，具体是哪个文件可以修改？

我熟悉 Django，但刚接触 Rails。

请帮帮我。

---

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [2022年三月22日 07:49 UTC](https://meta.discourse.org/t/discourse-website-path-urls-rename/221636/2 "2022-03-22T07:49:47Z")

</div>

请查看：

> **[Rails Routing from the Outside In — Ruby on Rails Guides](https://guides.rubyonrails.org/routing.html)**
>
> This guide covers the user-facing features of Rails routing.After reading this guide, you will know: How to interpret the code in config/routes.rb. How to construct your own routes, using either the preferred resourceful style or the match method....

这些看起来不像核心路由。

例如，`agenda` 在我的实例中不存在——你是否安装了插件？

如果是，请查看插件代码，特别是 `config/routes.rb`（或者可能在 `plugin.rb` 中）。

我建议花些时间阅读和理解源代码的结构。

---

<div class="post-metadata">

**Author:** ![Hemant\_Raju1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hemant_raju1/32/249206_2.png) [@Hemant\_Raju1](https://meta.discourse.org/u/Hemant_Raju1)\
**Post date:** [2022年三月22日 08:20 UTC](https://meta.discourse.org/t/discourse-website-path-urls-rename/221636/3 "2022-03-22T08:20:24Z")

</div>

@merefield ，没有，我没有安装任何插件，在类别设置中，如果您启用议程主题列表，那么在主页上将启用一个按钮来查看特定类别的事件。  
所以我重命名了该按钮，现在也想重命名 URL，但我找不到如何操作。

 ![Screenshot from 2022-03-22 13-47-18](https://global.discourse-cdn.com/meta/original/3X/d/0/d03af679060a01de0d419942aaf4900d5c3b9e4c.png)

---

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [2022年三月22日 08:24 UTC](https://meta.discourse.org/t/discourse-website-path-urls-rename/221636/4 "2022-03-22T08:24:37Z")

</div>

> [@Hemant\_Raju1](#):
>
> 我没有安装任何插件

这很奇怪，因为基础 Discourse 中没有这样的路由。

[https://raw.githubusercontent.com/discourse/discourse/main/config/routes.rb](https://raw.githubusercontent.com/discourse/discourse/main/config/routes.rb)

……请随意搜索“agenda”（议程）。

我不认为分类设置中默认有这样的部分。

我相信您一定安装了某个插件，可能是这个：

> <https://github.com/angusmcleod/discourse-events/blob/00fc913a97633daa0bd9fda950b09b984538a6b1/plugin.rb#L260>

---

<div class="post-metadata">

**Author:** ![Hemant\_Raju1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hemant_raju1/32/249206_2.png) [@Hemant\_Raju1](https://meta.discourse.org/u/Hemant_Raju1)\
**Post date:** [2022年三月22日 08:46 UTC](https://meta.discourse.org/t/discourse-website-path-urls-rename/221636/5 "2022-03-22T08:46:54Z")

</div>

我的错，你说得对，我猜是 discourse events 插件
