Can a node be accessible only by ajax?
You can control access to nodes with

hook_node_access

For example, to restrict node viewing on node/[nid] pages:

/**
 * Implements hook_node_access
 */
function MYMODULE_node_access($node, $op, $account) {

  // If viewing node and URL path is node/[nid]
  // where [nid] is current $node-&gt;nid
  if($op == 'view' &amp;&amp; arg(0) == 'node' &amp;&amp; arg(1) == $node-&gt;nid){
    // Deny access to view current node page
    return NODE_ACCESS_DENY;
  }

}


You can add your own conditions to get more specific about access control there.

If you want to deny access to all node/%node/view pages, you can do it quite simply with:

hook_menu_alter

For example, set the access callback to FALSE

/**
 * Implements hook_menu_alter
 */
function MYMODULE_menu_alter(&amp;$items) {
  // Disable the node view page at node/%node
  $items['node/%node']['access callback'] = FALSE;
}