Stops page execution and opens a ColdFusion page or HTML file.
Flow-control tags, Page processing tags
<cflocation url = "url" addToken = "Yes" or "No">
cfabort,
cfbreak,
cfexecute,
cfexit,
cfif,
cfloop,
cfswitch,
cfthrow,
cftry
You might write a standard message or response in a file, and call it from several applications. You could use this tag to redirect the user's browser to the standard file.
If you use this tag after the cfflush
tag on a page, an error is thrown.
Warning: Do not set a cookie variable on a page on which you use this tag. If you do, the cookie is not saved on the browser. Similarly, if you use a cookie to store a client variable, the client variable is not set.
<!--- This view-only example shows the use of cflocation ---> <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>This code redirects you to CFDOCS home page (if you remove the comment marks, this information displays in frame): <!--- <cflocation url = "../cfdocs/index.htm" addToken = "No"> --->