How do I force a 403/410 error code for specific users and content?
drupal_goto Can help you

drupal_goto($path = '', $query = NULL, $fragment = NULL, $http_response_code = 302)


Parameters


$path:
A Drupal path or a full URL.

$query:
A URL-encoded query string to append to the link, or an array of query
key/value-pairs without any URL-encoding. Passed to url().

$fragment:
A destination fragment identifier (named anchor).

$http_response_code:
Valid values for an actual &quot;goto&quot; as per RFC 2616 section 10.3 are:


301 Moved Permanently (the recommended value for most redirects)
302 Found (default in Drupal and PHP, sometimes used for spamming search
engines)
303 See Other
304 Not Modified
305 Use Proxy
307 Temporary Redirect (alternative to &quot;503 Site Down for Maintenance&quot;)


Note: Other values are defined by RFC 2616, but are rarely used and poorly
supported.