How to get rid of drupals default “/node” page

30 Jun

Do you want to get rid of drupals default “/node” page?

We all know Drupal has a default front page which shows a view of nodes promoted to home page.

We might forget that we can still go to this page and user can see the content in the manner we dont want user to see.

A simple trick is we can make it “page not found”.

We can use Drupal’s the custom_url_rewrite_inbound function..

Open your settings.php file (located at /sites/default/settings.php)

And append following code in it.

function custom_url_rewrite_inbound(&$result, $path, $path_language) {
  if ($path == 'node') {
    //this will cause a page not found
    $result = 0;
  }
}

This will make your /node “page not found”

Thanks

One Response to “How to get rid of drupals default “/node” page”

  1. Yeon June 30, 2011 at 5:35 pm #

    Thanks for this help

Leave a Reply

*