Txp die

On this page:


<txp:txp_die />

The txp_die tag is a single tag that will terminate normal page rendition and return the given status to the user agent (browser, search engine crawler, feed aggregator). An error page will also be returned to the user agent.

The status can be displayed by the error_status tag. A textual message can be associated with the error status and retrieved with the error_message tag. See also: @@Custom Error Pages@@.


Tag will accept the following attributes (case-sensitive):

Textual representation of the error condition.
Numerical representation of the error condition.
Typical values: 301, 302, 304, 307, 401, 403, 404, 408, 410, 503, or any other valid status code.
Default: 503.
url="url" v4.5.0+
Redirects to the specified URL. Can be used with redirection statuses 301, 302 and 307.
Default: unset.


Example 1: Force a 404 ‘not found’ error

<txp:txp_die status="404" />

Example 2: Issue a permanent redirect

<txp:txp_die status="301" url="https://example.com/new/location" />


Version 4.5.0

url attribute added.

See something wrong in this document? Outdated info, a broken link, faulty code example, or whatever? Please open an issue and we’ll investigate.