[development] [Redirect API] drupal_goto() and 301 permanentredirect.

Arto Bendiken arto.bendiken at gmail.com
Wed Jun 14 14:30:35 UTC 2006


On 6/14/06, Anguo <linux-tw at masquilier.org> wrote:
> I said I know how to do a redirect in php.
> I would like to know how to do it the 'Drupal
> Way' (drupal_goto() handles aliases, etc...).

Since drupal_goto() outputs the Location header and terminates script
execution, just set the 301 header before calling it:

  header('HTTP/1.1 301 Moved Permanently');
  drupal_goto(...);

-- 
Arto Bendiken | arto.bendiken at gmail.com | http://bendiken.net/


More information about the development mailing list