# URL Paths require all paths to resolve else resulting in a 404 page not found?

**URL:** <https://community.weweb.io/t/url-paths-require-all-paths-to-resolve-else-resulting-in-a-404-page-not-found/4941>\
**Category:** How do I?\
**Created:** [October 17, 2023, 9:11am UTC](https://community.weweb.io/t/url-paths-require-all-paths-to-resolve-else-resulting-in-a-404-page-not-found/4941 "2023-10-17T09:11:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AdamKB](https://avatars.discourse-cdn.com/v4/letter/a/eb9ed0/32.png) [@AdamKB](https://community.weweb.io/u/AdamKB)\
**Post date:** [October 17, 2023, 9:11am UTC](https://community.weweb.io/t/url-paths-require-all-paths-to-resolve-else-resulting-in-a-404-page-not-found/4941/1 "2023-10-17T09:11:52Z")

</div>

Hi all,

I have an existing site structure I would like to replicate such as:  
[example.com/search/laptops/accessories](http://example.com/search/laptops/accessories)

Currently I show different content on the page if the URL is like this:  
[example.com/search](http://example.com/search)  
[example.com/search/laptops](http://example.com/search/laptops)

I have discovered that in WeWeb that for a URL to resolve when using URL paths that each path must be defined eg.  
[example.com/search/{{path|value1}](http://example.com/search/%7B%7Bpath%7Cvalue1%7D)}/{{subpath|value2}}

So using the above structure:  
[example.com/search](http://example.com/search) - results in a 404 error  
[example.com/search/laptops](http://example.com/search/laptops) - results in a 404 error  
[example.com/search/laptops/accessories](http://example.com/search/laptops/accessories) - Shows page content.

Frustratingly the Editor permits you to change pages using missing URL paths, it has only been on publishing to staging that the web app causes the 404.

Is there anyway at all to stop WeWeb returning a 404 and actually displaying content when a URL path is not defined? I have conditional logic in place to manage this, it is just that the URL causes the 404.

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [October 20, 2023, 10:06am UTC](https://community.weweb.io/t/url-paths-require-all-paths-to-resolve-else-resulting-in-a-404-page-not-found/4941/2 "2023-10-20T10:06:33Z")

</div>

Hi @AdamKB 👋

Indeed this is not possible yet in WeWeb. We’re exploring the option of enabling this but for now, you would need 3 separate pages:

- one for search
- one for search/laptops
- one for search/laptops/accessories

If you use [multi-page sections](https://academy.weweb.io/build-a-proof-of-concept/multi-page-sections-spa/) to leverage the fact that WeWeb publishes an SPA, the user experience should still be great.

---

<div class="post-metadata">

**Author:** ![AdamKB](https://avatars.discourse-cdn.com/v4/letter/a/eb9ed0/32.png) [@AdamKB](https://community.weweb.io/u/AdamKB)\
**Post date:** [October 31, 2023, 3:28am UTC](https://community.weweb.io/t/url-paths-require-all-paths-to-resolve-else-resulting-in-a-404-page-not-found/4941/3 "2023-10-31T03:28:38Z")

</div>

Thanks @Joyce this was very helpful.  
I ended up creating 3 pages named as follows:

- search (root) - has no page paths
- search (path) - has 1 page path
- search (path and subpath) - Has 2 page paths

Then added the relevant logic and multi page sections for each page. So now each URL path resolves and I can maintain my URL structure that is already indexed in Google.

---

<div class="post-metadata">

**Author:** ![what.gift](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/what.gift/32/8069_2.png) [@what.gift](https://community.weweb.io/u/what.gift)\
**Post date:** [June 10, 2024, 12:45pm UTC](https://community.weweb.io/t/url-paths-require-all-paths-to-resolve-else-resulting-in-a-404-page-not-found/4941/4 "2024-06-10T12:45:38Z")

</div>

Hi @Joyce

Just checking if this is still the best way to achieve this as you mentioned you guys are “exploring the option”?

Also, how are language paths handled in a similar situation? Do we have to setup 2 pages or will it revert to just one? E.g.

> **[Free classifieds - yourdomain.com](https://www.yourdomain.com/)**
>
> Free classified ads with photos. Find houses and apts for rent, personals, jobs, cats, and dogs for sale.

> **[Free classifieds - yourdomain.com](https://www.yourdomain.com/)**
>
> Free classified ads with photos. Find houses and apts for rent, personals, jobs, cats, and dogs for sale.
