Rabbit Hole module

The Rabbit Hole module is useful when you create a content type that you want to use as a data source, and only display in some form that’s mediated by the Views module. In the Drupal for Humanists example site, the Event content type is a potential candidate. We use the Event content type to store information about events, but only display that data using Views-generated maps and timelines. But what happens if someone finds their way to the individual page of a particular event? Rabbit Hole lets you determine what happens.

Install and enable the Rabbit Hole module, and the sub-module “Rabbit Hole nodes”. (You can enable additional sub-modules for users, taxonomy terms, and files.) Go to Structure > Content types > Event (or whatever content type you want to not display on its own page). There’ll be a new set of options, “Rabbit Hole settings”, along with “Publishing options”, “Display settings”, “Automatic title generation” (if you have the Automatic Nodetitles module enabled), etc.
The default setting is to display the page as per usual, but you can also choose among the options “Access denied”, “Page not found”, or “Page redirect”. You may want to use page redirect to, for instance, point to a view where the data stored in the node can be found. If you select “Page redirect”, you can enter the URL that should be used; the text box can accept tokens, if the place that it should redirect to varies between nodes. The default response code (“301 Moved Permanently”) is usually fine. The link that’s included for more information on response codes isn’t particularly helpful, but this Wikipedia article is more informative.

Modules: