1

This is going to seem like an odd question. I am not sure if this is the way Views is meant to work but I want to see if I can turn it off.

Say I have a View with a Page Display with a defined URL like so: /testimonials

The Display takes not arguments what so ever. Here is the problem: I can now access this view using URLs like this:

  • /testimonials/5898
  • /testimonials/hello/what
  • /testimonials/stupid/appended/data

I can't for the life of me figure out how to turn this off in Views. Any ideas?

3
  • What would you like to happen when you access /testimonials/5898? Jul 5, 2012 at 20:52
  • 1
    Naturally, I would like it to throw a 404 error since a page at that path, in theory, does not exist. I don't mind writing code to do it but I would prefer if there is a way Views supports it. I also updated my question to give a better idea why this is a problem for me.
    – 9ee1
    Jul 5, 2012 at 20:54
  • This answer may help you too: drupal.stackexchange.com/questions/48093/…
    – braican
    Aug 22, 2014 at 14:52

1 Answer 1

0

5898 is just an extra URL argument in View's point of view. Views doesn't have the ability to throw 404 pages because there are "extra" arguments in the URL. Views does throw 404s when there is no argument in the URL (if configured that way). In any case, you can implement something like hook_views_pre_view() and redirect the user to a separate 404 page if you see that extra arguments are found in the URL. This should take like 15 minutes for a Drupal developer to do.

1
  • I was afraid of that. I would think that Views would support this if the display is not defined to accept arguments and there are arguments in in the URL. In any case, back to my IDE I go. Thanks for your help.
    – 9ee1
    Jul 5, 2012 at 21:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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