<p>Users create an account and their profile (<strong>domain.com/userName</strong>) is a template pulling info from craft users. </p>

<p>Each user can create entries, all stored in a Structure section (<strong>domain.com/userName/entrySlug</strong>). </p>

<p>Problem is when different users have an entry with the same title, entrySlug can become entrySlug-1 etc.  Although the URL is unique, the slug obviously can't be with entries in the same structure. </p>

<p>But I cannot think how to set this up. A structure per user seems overkill.</p>

<p>Thanks</p>

CC BY-SA 4.0
2020-04-30T11:49:52.003Z
Are you using a custom route to resolve `domain.com/userName/entrySlug`?
Oli
CC BY-SA 4.0
2020-04-30T12:36:12.140Z
@Oli Yea entry URI format  `{author.username}/{slug}`
Rich Holt
CC BY-SA 4.0
2020-04-30T12:52:03.323Z
That's odd, when I try locally, I'm not getting duplicate slugs. Which version of Craft are you on? Are your users creating entries via the Control Panel or a front-end entry form?
Oli
CC BY-SA 4.0
2020-04-30T13:01:13.253Z
That's the problem - not getting duplicate slugs. Say I have user1 and user2, they both might create an entry with the same title. So one of those users will get an entry slug of entrySlug-1. Would like entry slugs to be unique to the user, not all users.
Rich Holt
CC BY-SA 4.0
2020-04-30T13:20:28.967Z
Again, I'm not seeing the same thing as you. User A creates entry *about*, URI is `userA/about`, if user B creates an *about* entry, URI is `userB/about`. Now if user A creates another *about* entry, then the URI is `userA/about-1`. Are you testing via the Control Panel?
Oli
CC BY-SA 4.0
2020-04-30T13:28:55.247Z
Now I feel incredibly stupid. I was only testing a duplicate entry under 1 user and immediately went down a rabbit hole when I saw the potential problem. Thanks for getting me out!
Rich Holt
CC BY-SA 4.0
2020-05-01T08:32:17.727Z
Glad you're sorted!
Oli
<craft3><entries><sections><slug>
How to allow multiple entries to have the same slug?
# How to allow multiple entries to have the same slug?

(Asked by: username_0 on 2020-04-29)

Users create an account and their profile (**domain.com/userName**) is a template pulling info from craft users.

Each user can create entries, all stored in a Structure section (**domain.com/userName/entrySlug**).

Problem is when different users have an entry with the same title, entrySlug can become entrySlug-1 etc. Although the URL is unique, the slug obviously can't be with entries in the same structure.

But I cannot think how to set this up. A structure per user seems overkill.

Thanks

**Tags:** craft3, entries, sections, slug

> **Comments:**
> **username_1**: Are you using a custom route to resolve `domain.com/userName/entrySlug`?  
> **username_0**: @username_1 Yea entry URI format  `{author.username}/{slug}`  
> **username_1**: That's odd, when I try locally, I'm not getting duplicate slugs. Which version of Craft are you on? Are your users creating entries via the Control Panel or a front-end entry form?  
> **username_0**: That's the problem - not getting duplicate slugs. Say I have user1 and user2, they both might create an entry with the same title. So one of those users will get an entry slug of entrySlug-1. Would like entry slugs to be unique to the user, not all users.  
> **username_1**: Again, I'm not seeing the same thing as you. User A creates entry *about*, URI is `userA/about`, if user B creates an *about* entry, URI is `userB/about`. Now if user A creates another *about* entry, then the URI is `userA/about-1`. Are you testing via the Control Panel?  
> **username_0**: Now I feel incredibly stupid. I was only testing a duplicate entry under 1 user and immediately went down a rabbit hole when I saw the potential problem. Thanks for getting me out!  
> **username_1**: Glad you're sorted!  

---

## 0 answers

