M
M
MyQuestion2022-03-20 10:29:32
Drupal
MyQuestion, 2022-03-20 10:29:32

Drupal 7: Why doesn't the url for a view return 404 if it's invalid?

Good evening!

For view (representation), we prescribe url in the path field and, in theory, everything should work stably. But I noticed a few things.
- For some reason, the slug of the page does not fall into the HC (bread crumbs). For example, if I want to attach to a directory and write /catalog/collection-10 to HK I will see "catalog" without "collection 10".
- The URL for such links is processed quite strangely. Let's say I created a page with the address "/catalog/collection-10/", I write to the address of the slug of the non-existent page "/catalog/collection-10/segfarg1435" and I get 200ok. It doesn't matter what is written there. This situation works only for pages of type view (view). And this is the main reason why I came here.

How do I set up a 404 error or 301 redirect for pages of type view (views), if this page has no further nesting of the URI and it should return a 404, 403 error for non-existent pages?

In all other cases, non-existent pages are processed correctly.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MyQuestion, 2022-03-20
@MyQuestion

The solution was to install the views404 module
Article that helped solve my problem.
I'm not sure if the module is safe, because last update was in 2014 but it works. Although, it is difficult to talk about security if you work with old versions of cms.
ps. judging by the views and zero answers, I understand how old I have to work (

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question