Redirect Tag

Anytime this tag is rendered — whether in a template, partial, or content, Statamic will redirect the visitor to the specified URL.


Let’s redirect visitors to the homepage if they’re not logged in.

{{ if ! logged_in }}
  {{ redirect to="/" }}
{{ /if }}

How about RickRolling visitors if it’s April Fool’s Day?

{{ if (now|format:m-d) == "04-01" }}
  {{ redirect to="" }}
{{ /if }}


url string

Destination URL

to string

Alias of url

response integer

The HTTP response code to use. Default: 302 (temporary).

Betterify this page on Github!