# Probleem met FAQ-link bij edge case submap-configuratie

**URL:** <https://meta.discourse.org/t/issue-with-faq-link-on-edge-case-subfolder-setup/181798>\
**Category:** Bug\
**Tags:** subfolder\
**Created:** [3 maart 2021 om 16:26 UTC](https://meta.discourse.org/t/issue-with-faq-link-on-edge-case-subfolder-setup/181798 "2021-03-03T16:26:55Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![renato](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/renato/32/383632_2.png) [@renato](https://meta.discourse.org/u/renato)\
**Post date:** [3 maart 2021 om 16:26 UTC](https://meta.discourse.org/t/issue-with-faq-link-on-edge-case-subfolder-setup/181798/1 "2021-03-03T16:26:55Z")

</div>

First, this is an edge case **very** specific to my setup, with the `/f` subfolder.

Discourse link on hamburger menu points to `/faq`, without the subfolder, because [`/faq` startsWith `/f`](https://github.com/discourse/discourse/blob/c047640ad4547cef87bf2c2a8326e210d0b276dd/app/assets/javascripts/discourse-common/addon/lib/get-url.js#L19).

Considering this quote:

> [@Serve Discourse from a subfolder (path prefix) instead of a subdomain](https://meta.discourse.org/t/serve-discourse-from-a-subfolder-path-prefix-instead-of-a-subdomain/30507/1):
>
> Make sure it does _not_ end with a `/`

I guess we could change

```js
  const found = url.startsWith(baseUri);

```

to something like

```js
  const found = url === baseUri || url.startsWith(`${baseUri}/`);

```

So it would match `/f`, `/f/`, `/f/faq`, but not `/faq`, correctly prepending the baseUri to the latter.

Anyway, the route itself also doesn’t work, `/f/faq` returns a 404, so I think there’s similar logic on the router level. I’ve previously noticed that `/f/following` wasn’t working as well (cc @merefield).

Finally, I changed the `faq url` site setting to `/f/guidelines` as a workaround, which fixed the link and the 404, but generated a minor oddity of having both the Guidelines and FAQ terms on the nav bar, both pointing to what’s set on `faq url` (you can check on the [actual page](https://www.comparajogos.com.br/f/guidelines)):

 ![image](https://global.discourse-cdn.com/meta/original/3X/4/7/47ff8606a04774e4ada61f7e20f3aaddb2a43240.png)

Sorry for this kind of kitchen sink topic with 3 issues, but I think they’re so related that it’d be hard to separate them properly.

Thanks.

---

_[View the full topic](https://meta.discourse.org/t/issue-with-faq-link-on-edge-case-subfolder-setup/181798)._
