Docly Developers
Function Updated 23 Oct 2026

redirect(url)

Stops the page and redirects the browser to the specified url. Works in .hash pages and API functions, and is not swallowed by try/finally in your code.

Parameters

urlstringrequired

Url to redirect browser to.

Returns

Nothing — the call ends the request with HTTP 302 (Found, a temporary redirect) and a Location header. Must be called with exactly one argument; with any other number of arguments nothing happens and the page continues. For a permanent move (301), use a .old file at the old path instead — see the KB article "Redirect a moved page with a hash file". (Before 15 October 2026 docly.redirect answered 301.)

Example

Mixed HTML (or any text file) with inline JavaScript between hash signs.
#docly.redirect("https://docly.net")#