1

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

  • 2
    Maybe an .htaccess rewrite rule interfering? Do you have any custom routes defined (in the Craft CP or in config/routes.php)? – Brad Bell Jun 16 '17 at 15:35
  • 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 Jun 19 '17 at 7:22
  • 1
    Would you mind adding that as an official answer? Might end up pointing someone in the right direction in the future. – Brad Bell Jun 19 '17 at 22:52
1

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

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)? – Brad Bell

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.