<cflocation>
Redirect the current request to another URL.
For example, you might use <cflocation> to specify a standard message or response that you use in several applications.
Use the addToken attribute to verify client requests.
This tag may have a body.
This tag is also supported within <cfscript>
<cflocation
url=string
addToken=boolean
abort=boolean
statusCode=number
encode=boolean
><!--- body --->[</cflocation>]
| Attribute | Description |
|---|---|
url
string, required
|
edit
The URL of the HTML file or CFML page to open. |
addToken
boolean, optional
|
edit
Yes or No. clientManagement must be enabled, see cfapplication. Yes appends client variable information to the URL you specify in the url. |
abort
boolean, optional
|
edit
if set to true then the request will be aborted instead of redirected to allow developers to troubleshoot code that contains redirects Introduced: 6.0.0.114 |
statusCode
number, optional
|
edit
statuscode used for the redirect (301 or 302) |
encode
boolean, optional
|
edit
Encode the given URL value (changed behavior in Lucee 6.0) Introduced: 6.0.0.320 |
Examples
editSyntax for cflocation
<cflocation url="filename.ext" addToken="false">
See also
- Core CFML Language
- Location()
- <cfforward>
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)