How to disable drupal /node page

While developing drupal sites we may not need the drupal's default front page, i.e. /node

Even if we change the default frontpage for our drupal site, the /node page is still accessbile.

There are two ways to disable /node page 

1) Download this module Node Page Disable and follow procedures there.
2) Create a custom module and implement a hook_menu_alter and then disable the node menu. Follow the steps below to disable /node page manually in Drupal 7.
  a) Create a custom module, if this is your first time please go through the procedures specified here.
  b) Implement hook_menu_alter in your .module file.
 

c) Place the following code in the above implemented hook.

           $items['node']['access callback'] = FALSE;

  d) Flush the drupal cache and that it, you are done, now try to access /node, you should see access denied page.

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.