# Wrong route after selecting a Category and a tag using the drop downs on a subfolder setup

**URL:** https://meta.discourse.org/t/wrong-route-after-selecting-a-category-and-a-tag-using-the-drop-downs-on-a-subfolder-setup/180755
**Category:** Bug
**Tags:** subfolder
**Created:** [February 22, 2021, 3:36pm UTC](https://meta.discourse.org/t/wrong-route-after-selecting-a-category-and-a-tag-using-the-drop-downs-on-a-subfolder-setup/180755 "2021-02-22T15:36:13Z")
**Posts on this page:** 4
**Page:** 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: [February 22, 2021, 3:36pm UTC](https://meta.discourse.org/t/wrong-route-after-selecting-a-category-and-a-tag-using-the-drop-downs-on-a-subfolder-setup/180755/1 "2021-02-22T15:36:13Z")

</div>

Using a subfolder setup, when the user selects a tag after a category or a category after a tag, Discourse is using the route  
`/[subfolder]/tags/[subfolder]/c/[category slug]/[category id]/[tag]`  
instead of  
`/[subfolder]/tags/c/[category slug]/[category id]/[tag]`

Both [tag-drop.js](https://github.com/discourse/discourse/blob/d0d54bbeadc1839ceebc67cac01a8394b95dc890/app/assets/javascripts/select-kit/addon/components/tag-drop.js#L158) and [category-drop.js](https://github.com/discourse/discourse/blob/d0d54bbeadc1839ceebc67cac01a8394b95dc890/app/assets/javascripts/select-kit/addon/components/category-drop.js#L149) are calling [getCategoryAndTagUrl](https://github.com/discourse/discourse/blob/d0d54bbeadc1839ceebc67cac01a8394b95dc890/app/assets/javascripts/discourse/app/lib/url.js#L501), it uses [category.js#url](https://github.com/discourse/discourse/blob/d0d54bbeadc1839ceebc67cac01a8394b95dc890/app/assets/javascripts/discourse/app/models/category.js#L131) – which prepends the subfolder by calling `get-url.js#getURL` – to concatenate after `/tags/`. [tag-drop-link.js](https://github.com/discourse/discourse/blob/d0d54bbeadc1839ceebc67cac01a8394b95dc890/app/assets/javascripts/discourse/app/components/tag-drop-link.js#L18) also uses the same `url` method.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [February 23, 2021, 5:14am UTC](https://meta.discourse.org/t/wrong-route-after-selecting-a-category-and-a-tag-using-the-drop-downs-on-a-subfolder-setup/180755/2 "2021-02-23T05:14:21Z")

</div>

@vinothkannans can you investigate this issue?

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [February 26, 2021, 5:16pm UTC](https://meta.discourse.org/t/wrong-route-after-selecting-a-category-and-a-tag-using-the-drop-downs-on-a-subfolder-setup/180755/4 "2021-02-26T17:16:27Z")

</div>

[https://github.com/discourse/discourse/commit/0581c033d7166ab9fe18cf25f55495f4f6182fd5](https://github.com/discourse/discourse/commit/0581c033d7166ab9fe18cf25f55495f4f6182fd5)

This commit should fix the issue for you. Thanks for your bug report and detailed explanation.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 1, 2021, 1:36am UTC](https://meta.discourse.org/t/wrong-route-after-selecting-a-category-and-a-tag-using-the-drop-downs-on-a-subfolder-setup/180755/5 "2021-03-01T01:36:35Z")

</div>


