<p><a href="https://craftcms.stackexchange.com/questions/31220/use-of-duplicate-slugs-without-1/31221#31221">Jamie's answer</a> is correct.</p>

<p>If you set your <em>Settings → Categories → Category URI Format</em> to <code>{parent.uri}/{slug}</code> you will then be able have multiple time the same slug.</p>

<p>Craft will take the parent into consideration when saving the category therefore allowing you to have (in your case) <code>byc/saturday</code> and <code>wbr/saturday</code></p>

CC BY-SA 4.0
2019-11-27T10:56:56.587Z
Excellent, this was what I was after. I actually found that by inserting the category group though, `{parent.uri}/{slug}` caused this to duplicate when a sub-category existed but by using `{parent ? parent.uri : group.handle }/{slug}` with the help of [this answer](https://craftcms.stackexchange.com/a/28039/10285), it got it perfect but your answer was exactly what was needed to ensure duplicate slugs could be used - thanks :)
zigojacko
CC BY-SA 4.0
2019-11-26T18:57:01.147Z
2019-11-26T18:57:01.147Z
Oli
<p>Again, I've had a look online but couldn't figure out what I had to do.</p>

<p>Say I've got a category structure like the below:</p>

<ul>
<li>Category 1

<ul>
<li>Saturday</li>
<li>Sunday</li>
</ul></li>
<li>Category 2

<ul>
<li>Saturday</li>
<li>Sunday</li>
</ul></li>
</ul>

<p>How can I allow duplicate category slugs so that they can be like:</p>

<pre><code>/category-1/saturday/*
/category-2/saturday/*
</code></pre>

<p>Instead of:</p>

<pre><code>/category-1/saturday/*
/category-2/saturday-1/*
</code></pre>

<p>What I have found online talks about Entries and Routes and then setting it up do serve from specific template but I'm not really sure where to start with that as still trying to learn how to work with Craft.</p>

<p>For example, <a href="https://craftcms.stackexchange.com/a/31221/10285">this answer</a> mentions how it should be possible if the Entry URI Format has been set up correctly for Sections but I haven't set up sections for creating categories so I'm not sure how my case relates (if it's of any use, I embed a screenshot of what I am referring to and category structure below):</p>

<p><a href="https://i.sstatic.net/91U78.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/91U78.png" alt="Craft CMS Category Structure"></a></p>

<p>Is there not a simple way to just achieve duplicate slugs for categories as per my above example?</p>

<p>If I try changing the slug to say 'saturday', it just re-appends the -1 to the end again.</p>

<categories><slug>
Allowing duplicate slugs in category paths
# Allowing duplicate slugs in category paths

(Asked by: username_0 on 2019-11-26)

Again, I've had a look online but couldn't figure out what I had to do.
Say I've got a category structure like the below:

Category 1


Saturday
Sunday

Category 2


Saturday
Sunday


How can I allow duplicate category slugs so that they can be like:
/category-1/saturday/*
/category-2/saturday/*

Instead of:
/category-1/saturday/*
/category-2/saturday-1/*

What I have found online talks about Entries and Routes and then setting it up do serve from specific template but I'm not really sure where to start with that as still trying to learn how to work with Craft.
For example, this answer mentions how it should be possible if the Entry URI Format has been set up correctly for Sections but I haven't set up sections for creating categories so I'm not sure how my case relates (if it's of any use, I embed a screenshot of what I am referring to and category structure below):

Is there not a simple way to just achieve duplicate slugs for categories as per my above example?
If I try changing the slug to say 'saturday', it just re-appends the -1 to the end again.

**Tags:** categories, slug

---

## 1 answers

### Answer by username_1 on 2019-11-26. Score: 2 | Accepted answer

[Jamie's answer](https://craftcms.stackexchange.com/questions/31220/use-of-duplicate-slugs-without-1/31221#31221) is correct.

If you set your *Settings → Categories → Category URI Format* to `{parent.uri}/{slug}` you will then be able have multiple time the same slug.

Craft will take the parent into consideration when saving the category therefore allowing you to have (in your case) `byc/saturday` and `wbr/saturday`

> **Comments:**
> **username_0**: Excellent, this was what I was after. I actually found that by inserting the category group though, `{parent.uri}/{slug}` caused this to duplicate when a sub-category existed but by using `{parent ? parent.uri : group.handle }/{slug}` with the help of [this answer](https://craftcms.stackexchange.com/a/28039/10285), it got it perfect but your answer was exactly what was needed to ensure duplicate slugs could be used - thanks :)  

---

