# 从子文件夹（路径前缀）而不是子域提供 Discourse

**URL:** https://meta.discourse.org/t/serve-discourse-from-a-subfolder-path-prefix-instead-of-a-subdomain/30507
**Category:** Self-Hosting
**Tags:** docker, subfolder, how-to, advanced-setup
**Created:** [2015年六月26日 19:18 UTC](https://meta.discourse.org/t/serve-discourse-from-a-subfolder-path-prefix-instead-of-a-subdomain/30507 "2015-06-26T19:18:04Z")
**Posts on this page:** 1
**Showing post:** 102

<div class="post-metadata">

### Author: ![mattmon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mattmon/32/175049_2.png) [@mattmon](https://meta.discourse.org/u/mattmon)
#### Post date: [2020年四月1日 04:43 UTC](https://meta.discourse.org/t/serve-discourse-from-a-subfolder-path-prefix-instead-of-a-subdomain/30507/102 "2020-04-01T04:43:18Z")

</div>

感谢 @vvanpo

以下是我成功的做法：

```
RAILS_ENV=production bundle exec discourse remap '/uploads' '/<subfolder>/uploads'
RAILS_ENV=production bundle exec discourse remap '/user_avatar/<domain>' '/<subfolder>/user_avatar/<domain>'
RAILS_ENV=production bundle exec discourse remap '/images' '/<subfolder>/images'
RAILS_ENV=production bundle exec discourse remap '/plugins' '/<subfolder>/plugins'

```

---

_[View the full topic](https://meta.discourse.org/t/serve-discourse-from-a-subfolder-path-prefix-instead-of-a-subdomain/30507)._
