 

 [    ](https://www.facebook.com/sharer/sharer.php?u=https://www.skvare.com/markdownify/node/85&title=Non-existent%20URLs%20in%20Views%202 "Share to Facebook") [    ](https://www.linkedin.com/sharing/share-offsite/?url=https://www.skvare.com/markdownify/node/85 "Share to Linkedin") [    ](mailto:?subject=Non-existent%20URLs%20in%20Views%202&body=https://www.skvare.com/markdownify/node/85 "Share to Email") 

 

 

#  Non-existent URLs in Views 2 

 Drupal 

 

 



 Views 2 serves pages with for non-existent URLs instead of presenting a 404 Not Found Error.

A view with page display path set to *blog* creates a valid link at example.com/blog. This will show a list of blog posts, with an individual article at example.com/blog/new-article. However, an accidental link to example.com/blog/accidental-link will provide content from example.com/blog instead of the expected 404 Not Found Error, since no valid content exists there. This is a usability as well as SEO issue.

Searching discussions on [Drupal](http://drupal.org/node/392106) and [Groups.Drupal](http://groups.drupal.org/node/19750) yielded the right answers. The solution is to edit the view by adding an Argument of **Node: Nid**. Set it to **Display all values**, Validator: **Node**, and Argument type of **Node ID**. Set Action to take if argument does not validate: **Hide view / Page not found (404)**. Update the Argument and save the view.

Test at example.com/blog/accidental-link for a 404 Not Found Error - so often dreaded, this time desired!

For flexible error pages, take a look at the [CustomError](http://drupal.org/project/customerror) module.



 

 

- [Drupal](/tags/drupal)