This tag is unsupported in CFFiddle.
Stops execution of the current page and opens a ColdFusion page or HTML file.
<cflocation url = "URL" addToken = "yes|no" statusCode = "300|301|302|303|304|305|307">
You can specify this tag's attributes in an attributeCollection attribute whose value is a structure. Specify the structure name in the attributeCollection attribute and use the tag's attribute names as structure keys.
ColdFusion 11: The addToken attribute is modified. If Secure Profile is enabled, addToken's default value will be "false".
ColdFusion 8: Added the statusCode attribute.
Attribute |
Req/Opt |
Default |
Description |
---|---|---|---|
url |
Required |
|
URL of HTML file or CFML page to open. |
addToken |
Optional |
Default value is false (when the secure profile enabled). |
The clientManagement attribute must be enabled (see cfapplication).
New in ColdFusion 11: If Secure Profile is enabled, addToken's default value will be false.
|
statusCode |
Optional |
302 |
The HTTP status code, as follows:
|
You might write a standard message or response in a file, and call it from several applications. Use this tag to redirect the user's browser to the standard file. This tag has no effect if you use it after the cfflush tag on a page.
When using cfabort, cflocation, or cfcontent tags, the OnAbort method is invoked instead on OnRequestEnd.
<h3>cflocation Example</h3> <p>This tag redirects the browser to a web resource; normally, you would use this tag to go to a CF page or an HTML file on the same server. The addToken attribute lets you send client information to the target page.</p> <p>If you remove the comments, this code redirects you to CFDOCS home page:</p> <!--- <cflocation url = "http://localhost:8500/cfdocs/dochome.htm" addToken = "no"> --->
Sign in to your account