<p>As Brad pointed out in the comments on my question I had to take a look in the custom route's defined in the Craft CP. My client tried to make a custom route which looked like this:</p>

<p><a href="https://i.sstatic.net/X1DcO.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/X1DcO.png" alt="enter image description here"></a></p>

<p>This caused for every url containing one "/" to use that template that unfortunately actually was a template that's why it wouldn't give a 404.</p>

<p><strong>Original Comment:</strong></p>

<p>Maybe an .htaccess rewrite rule interfering? Do you have any custom routes defined (in the Craft CP or in config/routes.php)? – Brad Bell</p>

CC BY-SA 3.0
2017-06-20T07:17:59.280Z
2017-06-20T07:17:59.280Z
Justin Dekkers
<p>I have a website where my client can create entries in a couple of different channels.</p>

<p>Lets take a "news" channel. The url would be: "example.com/news/nameofpage"</p>

<p>Whenever a wrong url is entered manually behind "example.com/news/" (or maybe a wrong filled in link) it won't go to the 404 page but just enters the channel's template and display's an empty page. For everything else the 404 error works but whenever a channels slug is in the url as a first segment it only gives an empty template.</p>

<p><strong>EDIT:</strong></p>

<p>I figured out it happens all the time whenever there is a second segment in the url</p>

CC BY-SA 3.0
2017-06-16T15:35:34.390Z
Maybe an `.htaccess` rewrite rule interfering?  Do you have any custom routes defined (in the Craft CP or in `config/routes.php`)?
Brad Bell
CC BY-SA 3.0
2017-06-19T07:22:52.173Z
Took a look in the custom route's and our client setup a couple which gave the error's. I took them out and they work properly now.
Justin Dekkers
CC BY-SA 3.0
2017-06-19T22:52:09.667Z
Would you mind adding that as an official answer?  Might end up pointing someone in the right direction in the future.
Brad Bell
<templating><error><redirect><404>
Empty page instead of 404 error when url contains channel slug
# Empty page instead of 404 error when url contains channel slug

(Asked by: username_0 on 2017-06-16)

I have a website where my client can create entries in a couple of different channels.

Lets take a "news" channel. The url would be: "example.com/news/nameofpage"

Whenever a wrong url is entered manually behind "example.com/news/" (or maybe a wrong filled in link) it won't go to the 404 page but just enters the channel's template and display's an empty page. For everything else the 404 error works but whenever a channels slug is in the url as a first segment it only gives an empty template.

**EDIT:**

I figured out it happens all the time whenever there is a second segment in the url

**Tags:** templating, error, redirect, 404

> **Comments:**
> **username_1**: Maybe an `.htaccess` rewrite rule interfering?  Do you have any custom routes defined (in the Craft CP or in `config/routes.php`)?  
> **username_0**: Took a look in the custom route's and our client setup a couple which gave the error's. I took them out and they work properly now.  
> **username_1**: Would you mind adding that as an official answer?  Might end up pointing someone in the right direction in the future.  

---

## 1 answers

### Answer by username_0 on 2017-06-20. Score: 1 | Accepted answer

As Brad pointed out in the comments on my question I had to take a look in the custom route's defined in the Craft CP. My client tried to make a custom route which looked like this:

[![enter image description here](https://i.sstatic.net/X1DcO.png)](https://i.sstatic.net/X1DcO.png)

This caused for every url containing one "/" to use that template that unfortunately actually was a template that's why it wouldn't give a 404.

**Original Comment:**

Maybe an .htaccess rewrite rule interfering? Do you have any custom routes defined (in the Craft CP or in config/routes.php)? – username_1


---

