Skip to content

Instantly share code, notes, and snippets.

@opi
Last active December 16, 2015 12:28
Show Gist options
  • Select an option

  • Save opi/5434701 to your computer and use it in GitHub Desktop.

Select an option

Save opi/5434701 to your computer and use it in GitHub Desktop.
Mimic drupal rabbithole module
<?php
function mymodule_node_view($node, $view_mode, $langcode) {
// Mimic rabbit-hole module
if (node_is_page($node)) {
// Access denied:
drupal_access_denied();
drupal_exit();
// Page not found:
drupal_not_found();
drupal_exit();
// Redirect
$url = '';
drupal_goto($url);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment