Using the Rules module you can implement a rule that looks similar to this:
{ "rules_check_url" : {
"LABEL" : "Disallow node/* access",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules" ],
"ON" : { "init" : [] },
"IF" : [
{ "text_matches" : {
"text" : [ "site:current-page:url" ],
"match" : "node\/\\d+$",
"operation" : "regex"
}
}
],
"DO" : [
{ "drupal_message" : {
"message" : "Sorry, direct access to URLs like [site:current-page:url] is not allowed around here ...",
"type" : "error"
}
},
{ "redirect" : { "url" : "no_access" } }
]
}
}
The above rule does not (yet) take into account to only apply the "action" for selected roles only (eg so that admins can still use these paths to view a node). But for anybody a bit familiar with the Rules module, that is a straight forward "Condition" to add ...
To experiment with this rule in your own site, just copy the entire Rules code above, and paste it in a new Rule in your own site, created via the "Import" function. Then further edit/refine to make it fit in your own environment (e.g the "Sorry, ..." message to be shown).