Skip to content

Instantly share code, notes, and snippets.

@steffenr
Created September 18, 2012 06:07
Show Gist options
  • Save steffenr/3741515 to your computer and use it in GitHub Desktop.
Save steffenr/3741515 to your computer and use it in GitHub Desktop.
redirect /node to drupal-frontpage
<?php
/**
* Implementation of hook_menu_alter().
*/
function node2front_menu_alter(&$items) {
$items['node']['page callback'] = '_node2front_redirect';
}
/**
* Redirect back to the frontpage.
*/
function _node2front_redirect() {
$_REQUEST['destination'] = "<front>";
drupal_goto();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment