<p>I'd always defer to a Brad Bell answer, but if for some reason you needed to maintain the URI format and wanted to still customize a route you could use the Routes section of settings. <a href="https://docs.craftcms.com/v3/routing.html#dynamic-routes" rel="nofollow noreferrer">https://docs.craftcms.com/v3/routing.html#dynamic-routes</a></p>

CC BY-SA 4.0
2019-08-09T19:41:31.577Z
2019-08-09T19:41:31.577Z
Jessie Gilligan
<p>In Craft 3 under your section config change the URL config</p>

<p><a href="https://docs.craftcms.com/v3/sections-and-entries.html#sections" rel="nofollow noreferrer">https://docs.craftcms.com/v3/sections-and-entries.html#sections</a></p>

<p>SEE: Entry URI Formats</p>

<p>You can select what template it should render and what URL config you want</p>

<p>Failing this you can use something more advanced:</p>

<p><a href="https://docs.craftcms.com/v3/routing.html#advanced-routing-with-url-rules" rel="nofollow noreferrer">https://docs.craftcms.com/v3/routing.html#advanced-routing-with-url-rules</a></p>

CC BY-SA 4.0
2019-08-12T07:18:37.497Z
Thanks, I've done both but it doesn't seem to work.

Is there something wrong with this code?

`code:
return [

    // Route videos/{slug} to a template
    'videos/<entrySlug:{slug}>' => ['template' => 'templates/videos/_entry'],

];`
Sebastiaan Schillebeeckx
CC BY-SA 4.0
2019-08-12T07:34:38.267Z
What error are you getting? Page not found or Variable "entry" does not exist.
Dean Sanderson
CC BY-SA 4.0
2019-08-12T07:46:56.927Z
"Not Found
The requested URL /videos/elia was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."
Sebastiaan Schillebeeckx
CC BY-SA 4.0
2019-08-12T07:56:05.540Z
Remove templates/ from your template variable, try: 'videos/<entrySlug:{slug}>' => ['template' => 'videos/_entry']
Dean Sanderson
CC BY-SA 4.0
2019-08-12T19:50:24.773Z
That also doesn't work. Maybe I have to do something with my folder structure?
Sebastiaan Schillebeeckx
CC BY-SA 4.0
2019-08-13T05:46:53.780Z
Yeh templates don’t go in the web folder normally. The template folder should be along side the web folder. Shouldn’t be much in the web folder really only index and a few resource filesz
Dean Sanderson
CC BY-SA 4.0
2019-08-14T12:22:29.647Z
If everything is working by accessing: /cms/web/videos/barco-auro your rule needs to be:

 'videos/<entrySlug:{slug}>' => ['template' => '/cms/web/videos/_entry']
Dean Sanderson
CC BY-SA 4.0
2019-08-09T18:05:53.057Z
2019-08-09T19:23:48.097Z
2019-08-09T19:23:48.097Z
Dean Sanderson
<p>I got entries in the folder /cms/web/videos/ and the url display this: <a href="http://domainname.com/cms/web/videos/barco-auro" rel="nofollow noreferrer">http://domainname.com/cms/web/videos/barco-auro</a>.</p>

<p>I want it to be this: <a href="http://domainname.com/videos/barco-auro" rel="nofollow noreferrer">http://domainname.com/videos/barco-auro</a>.</p>

<p>How do I create clean URLs? I don't find anything on this, or nothing that helps my problem.</p>

<url><slug><entry-slug><uri>
How to remove something from the slug/url
# How to remove something from the slug/url

(Asked by: username_0 on 2019-08-09)

I got entries in the folder /cms/web/videos/ and the url display this: <http://domainname.com/cms/web/videos/barco-auro>.

I want it to be this: <http://domainname.com/videos/barco-auro>.

How do I create clean URLs? I don't find anything on this, or nothing that helps my problem.

**Tags:** url, slug, entry-slug, uri

---

## 2 answers

### Answer by username_1 on 2019-08-09. Score: 2

I'd always defer to a Brad Bell answer, but if for some reason you needed to maintain the URI format and wanted to still customize a route you could use the Routes section of settings. <https://docs.craftcms.com/v3/routing.html#dynamic-routes>


---

### Answer by username_2 on 2019-08-09. Score: 2

In Craft 3 under your section config change the URL config

<https://docs.craftcms.com/v3/sections-and-entries.html#sections>

SEE: Entry URI Formats

You can select what template it should render and what URL config you want

Failing this you can use something more advanced:

<https://docs.craftcms.com/v3/routing.html#advanced-routing-with-url-rules>

> **Comments:**
> **username_0**: Thanks, I've done both but it doesn't seem to work.  Is there something wrong with this code?  `code: return [      // Route videos/{slug} to a template     'videos/<entrySlug:{slug}>' => ['template' => 'templates/videos/_entry'],  ];`  
> **username_2**: What error are you getting? Page not found or Variable "entry" does not exist.  
> **username_0**: "Not Found The requested URL /videos/elia was not found on this server.  Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."  
> **username_2**: Remove templates/ from your template variable, try: 'videos/<entrySlug:{slug}>' => ['template' => 'videos/_entry']  
> **username_0**: That also doesn't work. Maybe I have to do something with my folder structure?  
> **username_2**: Yeh templates don’t go in the web folder normally. The template folder should be along side the web folder. Shouldn’t be much in the web folder really only index and a few resource filesz  
> **username_2**: If everything is working by accessing: /cms/web/videos/barco-auro your rule needs to be:   'videos/<entrySlug:{slug}>' => ['template' => '/cms/web/videos/_entry']  

---

