How do I set my views to return a 404 using Global: Null under contextual filters? Standard Drupal behavior is to pass all arguments through, whether or not they requested. Sometimes this behavior is desired. However, I need to return a 404 for anything but a query string.

Example of the problem
http://drupal.org/project/modules
http://drupal.org/project/modules/google.com &lt;- This should return a 404; 200 given. Duplicate content penalty!

The views 404 module assumes that by default you do not want arguments passed through. However there is no D7 version of the module. 

But the project page says that 404s for views can also be accomplished by setting the Global: Null under Arguments.

Obviously in D7 "arguments" are now "contextual filters", but I am unsure as to what settings to add to the Global:null contextual filter to get my desired result. 

Any help would be appreciated.
In Contextual filters select Add; in the dialog box that appears, select Global: Null.



Click on Add and configure contextual filters.

In the dialog box that appear next, in the fieldset When the filter value is available or a default is provided, check Specify validation criteria, select - Basic validation - for Validator, and select Show "Page not found" for Action to take if the filter value does not validate. In the fieldset More, check Fail basic validation if any argument is given.



I tested it with an "Articles" view I created, and it works.





The "Global: Null" argument must be the last one. If you need a user ID, for example, first you add it as argument, and then add the "Global: Null" argument.

I altered the "Article" view to accept a user ID as argument, which is used to filter the list of article nodes. The view still works, as it doesn't accept an extra argument.