No navigation links on 404 pages When I visit a page that does not exist, I expect to still see the primary and secondary links as on any other page, but what I get is no navigation links in the 404 page. See also No navigation links on 404 pages.

I have found a solution, but I am happy if something else can fix this (possibly without using extra modules).
You can do it by defining a page in a custom module.

Create a page for the category "Page not found" using hook_menu().

function MODULE_menu() {
  $items['page-not-found'] = array(
    'title' =&gt; '',
    'page callback' =&gt; 'MODULE_page_not_found',
    'access callback' =&gt; TRUE,
  );
  return $items;
}

function MODULE_page_not_found() {
  drupal_set_title('Page not found');
  $cust_err = "";
  $cust_err = $cust_err . "The requested page " . current_path() . " could not be found";
  return $cust_err;
}


The page callback uses current_path() to return the path of the page causing the 404 error.

Go to Admin > Config > System > Site-information, and enter page-not-found (same name as defined in hook_menu) under Default 404 (not found) page.



Now the error page appears like in the following screenshot.



It is clear that it contains all the navigation links, and also the page URL producing the error (very similar to the original page not found). And the module mentioned in the answer above by @Nikhil will output "The requested page could not be found." but does not contain the URL of the page causing the error.