I want to get the node number (nid) for the node which is set for 403 and 404 pages in drupal configuration system. Can you please help me for this ?

3 Answers 3


You need to use


It will return a string like "node/1", then you just have to parse this string to get back the node ID.


You don't mention if this is via code or just admin screens. Through the admin screens you can view/edit what page is set for the 403 and 404 pages:

"Configuration > System > Site information"


Thanks all for answering this, I tried this

global $conf;

It is working fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.