Drupal 7 如何使用函数在Drupal中重写url

Drupal 7 如何使用函数在Drupal中重写url,drupal-7,drupal-modules,Drupal 7,Drupal Modules,我想使用Drupal函数重定向我的自定义url,请帮助我此重写方法使用哪些函数以及此方法的任何代码片段 drupal 7 drupal_goto有一个函数,您可以使用它重定向内部drupal路径以及外部url,只需添加一个如下参数 drupal_goto$url,数组'external'=>TRUE 请查看此函数的API文档 说明: $options:可选附加选项的关联数组,包含以下元素: “查询”:查询键/值对的数组,不带任何 要附加到URL的URL编码 'fragment': A fragm

我想使用Drupal函数重定向我的自定义url,请帮助我此重写方法使用哪些函数以及此方法的任何代码片段

drupal 7 drupal_goto有一个函数,您可以使用它重定向内部drupal路径以及外部url,只需添加一个如下参数

drupal_goto$url,数组'external'=>TRUE

请查看此函数的API文档

说明: $options:可选附加选项的关联数组,包含以下元素:

“查询”:查询键/值对的数组,不带任何 要附加到URL的URL编码

'fragment': A fragment identifier (named anchor) to append to the
URL. Do not include the leading '#' character.

'absolute': Defaults to FALSE. Whether to force the output to be an
absolute link (beginning with http:). Useful for links that will be
displayed outside the site, such as in an RSS feed.

'alias': Defaults to FALSE. Whether the given path is a URL alias
already.

'external': Whether the given path is an external URL.

'language': An optional language object. If the path being linked to
is internal to the site, $options['language'] is used to look up the
alias for the URL. If $options['language'] is omitted, the global
$language_url will be used.

'https': Whether this URL should point to a secure location. If not
defined, the current scheme is used, so the user stays on HTTP or
HTTPS respectively. TRUE enforces HTTPS and FALSE enforces HTTP, but
HTTPS can only be enforced when the variable 'https' is set to TRUE.

'base_url': Only used internally, to modify the base URL when a
language dependent URL requires so.

'prefix': Only used internally, to modify the path when a language
dependent URL requires so.

'script': The script filename in Drupal's root directory to use when
clean URLs are disabled, such as 'index.php'. Defaults to an empty
string, as most modern web servers automatically find 'index.php'.
If clean URLs are disabled, the value of $path is appended as query
parameter 'q' to $options['script'] in the returned URL. When
deploying Drupal on a web server that cannot be configured to
automatically find index.php, then hook_url_outbound_alter() can be
implemented to force this value to 'index.php'.

'entity_type': The entity type of the object that called url(). Only
set if url() is invoked by entity_uri().

'entity': The entity object (such as a node) for which the URL is
being generated. Only set if url() is invoked by entity_uri().
$http_response_code:可选用于重定向的http状态代码,默认为302。RFC 2616和新HTTP状态代码草案中定义了3xx重定向状态代码的有效值:

301:永久移动大多数重定向的建议值

302:在Drupal和PHP中找到默认值,有时用于垃圾搜索引擎

303:见其他

304:未修改

305:使用代理

307:临时重定向

如果我遗漏了什么,请告诉我