REDIRECT
Set an HTTP redirect response. Emits a Location header and the specified status code. Returns the URL string and does not terminate the chain — subsequent steps still execute but their output is ignored by the browser.
Basic redirect
REDIRECT "https://ocalt.com" AS "302"
Permanent redirect
REDIRECT "https://ocalt.com/new-page" AS "301"
Default status — 302
(* AS is optional — defaults to 302 if omitted *)
REDIRECT "https://ocalt.com"
Redirect with variable URL
STRING "https://myapp.ocalt.site/dashboard" SET ?url
AFTER REDIRECT ?url
Redirect after login
LOGIN ?data(username) WITH ?data(password) SET ?tok
AFTER IF ?tok IS NULL
OPEN NEST
STATUS 401
AFTER EMIT "Invalid credentials"
CLOSE NEST
ELSE OPEN NEST
COOKIE "session" AS ?tok(token) WITH "/"
AFTER REDIRECT "/dashboard"
CLOSE NEST
Redirect to notifications portal
SESSION !COOKIE(session) SET ?user
AFTER NOTIFY REQUEST PUSH GRANT FOR ?user(id) WITH "https://myapp.ocalt.site/home"
Redirect to bridge room — camera feed
NEW VIDEO BRIDGE 2 PEERS SET ?room
AFTER DIRECTIVE "home-server" OPEN NEST
REDIRECT ?room(peers)(0)(join_url)
CLOSE NEST
AFTER REDIRECT ?room(peers)(1)(join_url)
Redirect to tunnel receiver
NEW TUNNEL SET ?room
AFTER TUNNEL SEND "/mounted/report.pdf" TO ?room
AFTER REDIRECT ?room(receiver_url)
Verb reference
| Verb | Description |
|---|---|
REDIRECT "url" | 302 redirect to URL string |
REDIRECT "url" AS "301" | Permanent redirect |
REDIRECT "url" AS "302" | Temporary redirect (explicit) |
REDIRECT ?var | Redirect to URL from variable |