How to prevent access to a page but allow query I have a page defined by Views module.
(for example: http://namedomainnn.com/cvstaff)

However, I want user only allow to access using query command)
(for example: http://namedomainnn.com/cvstaff?name=user1)

How can I prevent any users to access without query.
Simply check that your URL parameter exists and it's not empty before loading your view:

/**
 * Implements hook_views_pre_view().
 */
function MY_MODULE_views_pre_view(&amp;$view, &amp;$display_id, &amp;$args) {
  if ($view-&gt;name == 'MY_VIEW_NAME') {
    // If your URL parameter doesn't exist or it's empty, deny access.
    if (!isset($_GET['name']) || empty($_GET['name'])) {
      drupal_access_denied();
      exit();
    }
  }
}


So, accessing:

http://example.com/cvstaff?name=user will work.

http://example.com/cvstaff will show an Access Denied page.