# Question about unique UIDs and hierarchical URLs

**URL:** <https://community.prismic.io/t/question-about-unique-uids-and-hierarchical-urls/3865>\
**Category:** Developing with Prismic\
**Created:** [February 3, 2021, 4:49pm UTC](https://community.prismic.io/t/question-about-unique-uids-and-hierarchical-urls/3865 "2021-02-03T16:49:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tmiller](https://avatars.discourse-cdn.com/v4/letter/t/cab0a1/32.png) [@tmiller](https://community.prismic.io/u/tmiller)\
**Post date:** [February 3, 2021, 4:49pm UTC](https://community.prismic.io/t/question-about-unique-uids-and-hierarchical-urls/3865/1 "2021-02-03T16:49:15Z")

</div>

Hi there –

I found [this page](https://user-guides.prismic.io/en/articles/1069971-setting-up-and-retrieving-hierarchical-content) about creating hierarchical relationships between documents (e.g., parent and child pages).

I also gather that you're supposed to [use the UID field type for URL slugs](https://user-guides.prismic.io/en/articles/383719-uid).

However, I've run into a limitation.

Since a document's UID must be unique within its content type, it isn't possible to have two URLs which contain the same segment – e.g.:

/capabilities/web-development  
/tutorials/web-development

Prismic won't allow me to create the second page, because there's already a document with the UID "web-development".

I guess I could use a Key Text field (instead of a UID field) to represent a page's URL slug – but then I can't make the field required, and I can't prevent content authors from creating duplicate URLs.

Is there a workaround?

Thanks.

---

<div class="post-metadata">

**Author:** ![samlittlefair](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/samlittlefair/32/696_2.png) [@samlittlefair](https://community.prismic.io/u/samlittlefair)\
**Post date:** [February 4, 2021, 11:44am UTC](https://community.prismic.io/t/question-about-unique-uids-and-hierarchical-urls/3865/4 "2021-02-04T11:44:44Z")

</div>

Hi @tmiller ,

As you noted, UIDs are unique among Custom Types. For your use case — having the same UID for two different paths — we would recommend creating two different Custom Types. In this case, a "Capabilities" Custom Type and a "Tutorials" Custom Type. That way you can avoid name-spacing issues, and make use of all of the benefits of the UID field (truly unique, required, `getByUID()` helper functions, etc).

Otherwise, it is certainly possible to use the Key Text field to construct your URL path, but we wouldn't recommend it for the reasons you described — it isn't necessarily unique, or required, and it's also not encoded for a URL.

I hope that helps! Let me know if you have other questions.

Sam

---

<div class="post-metadata">

**Author:** ![samlittlefair](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/samlittlefair/32/696_2.png) [@samlittlefair](https://community.prismic.io/u/samlittlefair)\
**Post date:** [February 10, 2021, 5:01pm UTC](https://community.prismic.io/t/question-about-unique-uids-and-hierarchical-urls/3865/7 "2021-02-10T17:01:56Z")

</div>

This issue has been closed due to inactivity. [Flag to reopen](https://community.prismic.io/t/re-open-a-thread/2175).

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [December 9, 2021, 12:06pm UTC](https://community.prismic.io/t/question-about-unique-uids-and-hierarchical-urls/3865/8 "2021-12-09T12:06:10Z")

</div>


