go($url = '/', $code = 302)

Redirects to a different URL

  • $url (string)
    Absolute or relative URL
  • $code (int)
    HTTP status code like 301

Example

Simple internal redirect

go('blog');

External redirect

go('http://getkirby.com');

2.3.2 +

Permanent redirect

go('blog', 301);