Drupal Views Page - 404 anything beyond the page address
Problem: A View Page set up for www.xyz.com/things-to-do displays the same page when requests like this are made
www.xyz.com/things-to-do/events/something-else
www.xyz.com/things-to-do/events/763.aspx
www.xyz.com/things-to-do/events/763.aspx?duh=wow
We want those all to return 404 so old links can die out.
Solution : The trick is to set a NULL argument and validate against it. This method is encouraged for all View pages that do not otherwise have contextual filters in use.
Steps for setting the NULL argument
- Edit the View
- Add a Contextual Filter for Global: Null
- Check the box for "Specify validation criteria"
- Set Basic Validation
Page Not Found
Check the box for Fail basic validation if any argument is given.