redirect — Interrupt processing and divert to a new URL
::rivet::redirect diverts the browser to a new URL and marks the redirection as either permanent in the browser local cache or non permanent (default). Calling ::rivet::redirect causes the script execution to interrupt and control passes to AbortScript, if such script is set, by calling ::rivet::abort_page and passing as abort code a dictionary with 2 keys:
::rivet::redirect drives the redirection by setting the 301 (permanent = 1: permanent redirect) or 302 (permanent = 0: non permanent redirect) and attempts to discard the output the script might have already placed in the stdout channel buffer. The “permanent” argument can also be any of the other HTTP status codes. This is handy for returning one the 3xx status codes dedicated to the HTTP request redirection The command can fail if
The stdout channel, like any Tcl channels, can be manipulated and if needed its internal buffer stretched.