# User profile "top categories" URLs wrong for sub categories

**URL:** <https://meta.discourse.org/t/user-profile-top-categories-urls-wrong-for-sub-categories/93790>\
**Category:** Bug\
**Created:** [8월 2, 2018, 5:52오후 UTC](https://meta.discourse.org/t/user-profile-top-categories-urls-wrong-for-sub-categories/93790 "2018-08-02T17:52:36Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![dnsmichi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dnsmichi/32/379505_2.png) [@dnsmichi](https://meta.discourse.org/u/dnsmichi)\
**Post date:** [8월 2, 2018, 5:52오후 UTC](https://meta.discourse.org/t/user-profile-top-categories-urls-wrong-for-sub-categories/93790/1 "2018-08-02T17:52:37Z")

</div>

One of our users reported that the top categories in the user profile generate a permission denied error for their links.

My analysis and investigation is below, from what I can see this is a new feature in git master. [add links to Top Categories on user summary page · discourse/discourse@8e5e7c6 · GitHub](https://github.com/discourse/discourse/commit/8e5e7c6b436e9a9722929f1b66abc9925ee7989c)

## Versions

Latest HEAD from today: [https://github.com/discourse/discourse/compare/1ca999fdb58558171166e0dfbe10e10b374d3e33...tests-passed](https://github.com/discourse/discourse/compare/1ca999fdb58558171166e0dfbe10e10b374d3e33...tests-passed)

## Steps to reproduce

- Navigate to a profile - Summary - Top Categories
- Pick a category which is a sub category to a main one

### Example

For example, my profile on [https://monitoring-portal.org/u/dnsmichi/summary](https://monitoring-portal.org/u/dnsmichi/summary) → “Icinga 2” is a sub category of “Icinga”.

 ![Auswahl_218](https://global.discourse-cdn.com/meta/original/3X/0/5/0542098f9b62ead087c7188b11b52cfc1b5221af.png)

The URL just contains the direct link but misses the `/icinga` in its path being the main category.

Wrong: `https://monitoring-portal.org/c/icinga-2`  
Correct: `https://monitoring-portal.org/c/icinga/icinga-2`

Thanks for looking into it, I honestly don’t understand the code 🙂

---

_[View the full topic](https://meta.discourse.org/t/user-profile-top-categories-urls-wrong-for-sub-categories/93790)._
