Stops execution of the current page and redirects to the given URL.
location(url [, addtoken] [, statuscode])
returns void
| Name | Type | Required | Default | Description | Values | |
|---|---|---|---|---|---|---|
| url | string | Yes | URL of web page to open. | |||
| addtoken | boolean | No | YES | clientManagement must be enabled (see cfapplication). | ||
| statuscode | numeric | No | 302 | The HTTP status code | /Users/garethedwards/development/github/cfdocs/docs/functions/location.md | 307 |
Relocates to a different page if user is not logged in.
if (!structKeyExists(session, "userID") {
location("login.cfm");
}