<p>I ran into a similar problem with categories and routing a while ago and Marion's answer in this thread worked for me</p>

<p><a href="https://craftcms.stackexchange.com/questions/1291/how-would-i-include-the-first-category-slug-in-the-sections-entry-url-format">How would I include the first category slug in the section&#39;s entry URL format?</a></p>

<p>Darrell</p>

CC BY-SA 3.0
2015-11-30T13:01:11.443Z
Thanks Darrell
Not sure if that is the same problem - I have a URI with category in it (not category name) followed by the category slug. Have got working in other contexts but in this instance is throwing a 404 error :(
Cole Henley
CC BY-SA 3.0
2015-11-30T14:06:54.257Z
Silly questions but are all your categories coming from one group? If you have multiple groups, do they all have "Categories in this group have their own URLs" ticked? Just troubleshooting ;)
Oli
CC BY-SA 3.0
2015-12-02T15:32:35.990Z
More silly questions but is your template path correct in your route?
kcolls
CC BY-SA 3.0
2015-11-30T12:44:39.523Z
2015-11-30T12:44:39.523Z
2017-04-13T12:50:59.930Z
Darrell Wilson
<p>I've set up some dynamic routes to work with categories, so for example the route is set up to load a specific template if the work category appears in the URI, thus:</p>

<pre><code>news-events/image-gallery/category/[slug]
</code></pre>

<p>However, if I test with the following URL I get a 404 error:</p>

<pre><code>/news-events/image-gallery/category/drama
</code></pre>

<p>Other dynamic routes are working fine. Thoughts on how to debug/resolve appreciated.</p>

<p>Cole</p>

<routes><category><404>
Dynamic route returning 404 error
# Dynamic route returning 404 error

(Asked by: username_0 on 2015-11-30)

I've set up some dynamic routes to work with categories, so for example the route is set up to load a specific template if the work category appears in the URI, thus:
news-events/image-gallery/category/[slug]

However, if I test with the following URL I get a 404 error:
/news-events/image-gallery/category/drama

Other dynamic routes are working fine. Thoughts on how to debug/resolve appreciated.
Cole

**Tags:** routes, category, 404


---

## 1 answers

### Answer by username_1 on 2015-11-30. Score: 1

I ran into a similar problem with categories and routing a while ago and Marion's answer in this thread worked for me

[How would I include the first category slug in the section's entry URL format?](https://craftcms.stackexchange.com/questions/1291/how-would-i-include-the-first-category-slug-in-the-sections-entry-url-format)

Darrell

> **Comments:**
> **username_0**: Thanks Darrell Not sure if that is the same problem - I have a URI with category in it (not category name) followed by the category slug. Have got working in other contexts but in this instance is throwing a 404 error :(  
> **username_2**: Silly questions but are all your categories coming from one group? If you have multiple groups, do they all have "Categories in this group have their own URLs" ticked? Just troubleshooting ;)  
> **username_3**: More silly questions but is your template path correct in your route?  

---

