# Make forum available on a subpath via additional route

**URL:** <https://meta.discourse.org/t/make-forum-available-on-a-subpath-via-additional-route/89453>\
**Category:** Development\
**Created:** [June 8, 2018, 3:24pm UTC](https://meta.discourse.org/t/make-forum-available-on-a-subpath-via-additional-route/89453 "2018-06-08T15:24:18Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![kleinfreund](https://avatars.discourse-cdn.com/v4/letter/k/a6a055/32.png) [@kleinfreund](https://meta.discourse.org/u/kleinfreund)\
**Post date:** [June 8, 2018, 3:24pm UTC](https://meta.discourse.org/t/make-forum-available-on-a-subpath-via-additional-route/89453/1 "2018-06-08T15:24:18Z")

</div>

I’m trying to reroute the forum from the root path `/` to a subpath (i.e. `/forum`) in order to show another page at the root path.

For now, I just want be able to show the forum at `/forum`. I do not want to install Discourse on that subpath, though.

First of all, via a plugin, I add the following route:

```ruby
Discourse::Application.routes.append do
  get '/forum' => 'list#latest'
end

```

Next, I tried to add a fitting route to [`app-route-map.js.es6#L18`](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/routes/app-route-map.js.es6#L18), replacing the following

```js
this.route('discovery', { path: '/', resetNamespace: true }, // …

```

with

```js
this.route('discovery', { path: '/forum', resetNamespace: true }, // …

```

So far, this is not working as I’d hoped. In particular, the first Ember transition is from `''` to `discovery.index` whereas a regular installation will transition from `''` to `discovery.latest`.

Can anyone offer some help as to what I’ve missed or misunderstood?

I’m aware that this might be an unusual request.

* * *

**Update, June 8th, 18:27** : The following works when going to `/forum/latest`:

**`plugins/plugin-name/plugin.rb`** :

```ruby
Discourse::Application.routes.append do
  get '/forum/latest' => 'list#latest'
end

```

**`app/assets/javascripts/discourse/routes/app-route-map.js.es6`** :

```js
this.route('discovery', { path: '/forum', resetNamespace: true }, // …

```

Now, how would I set things up to be able to open `/forum` with the same result?

* * *

**Update, June 8th, 20:09** : Additionally, the following changes need to be made to have the navigation bar links work under the subpath:

- **`app/assets/javascripts/discourse/models/nav-item.js.es6`** :  
Change `Discourse.getURL("/")` to `Discourse.getURL("/forum/")`.
- **`app/assets/javascripts/select-kit/components/category-drop.js.es6`** :  
Change `Discourse.getURL("/c/")` to `Discourse.getURL("/forum/c/")`.

Probably, other similar changes need to be made to.

---

_[View the full topic](https://meta.discourse.org/t/make-forum-available-on-a-subpath-via-additional-route/89453)._
