Redirect
→ voidOfficially documented bare-name redirect helper that does NOT exist at runtime — use Platform.Response.Redirect instead.
Syntax
Redirect(url, movedPermanently)
Does not exist at runtime. Despite appearing in the official documentation, the bare-name Redirect global is undefined in CloudPages under every Core version tested (1, 1.1.1, 1.1.5). Calling it throws a ReferenceError. Use Platform.Response.Redirect(url, movedPermanently) instead — it is always available.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
url |
string | Yes | The address to send the browser to. |
movedPermanently |
boolean | Yes | true issues an HTTP 301 Moved Permanently redirect; false issues an HTTP 302 Found (“Moved Temporarily”) redirect. Use false unless you are certain the move is permanent — browsers cache 301 responses aggressively and may skip re-checking the original URL. |
Description
The official docs describe Redirect(url, movedPermanently) as a bare-name helper that sends the visitor’s browser to another URL. Runtime testing proves this global is not defined in CloudPages regardless of the Core library version loaded, so it cannot be used. Its documented sibling Platform.Response.Redirect() is the working equivalent and requires no Platform.Load.
Working example — use Platform.Response.Redirect
Platform.Response.Redirect("https://www.example.com", false);
Known bug — redirect inside try/catch
This caveat applies to Platform.Response.Redirect() as well: if a try block contains a redirect, the redirect triggers the catch block. In the example below the intended redirect to salesforce.com is overridden by the catch redirect to example.com:
try {
Platform.Response.Redirect("https://salesforce.com", false);
} catch (ex) {
Platform.Response.Redirect("https://example.com", false);
}
Keep redirects out of try blocks, or guard the catch so it does not perform its own redirect.