- redirect-to uriprocedure
Perform an HTTP redirection (code 302) to the given uri (either a string or a uri-common URI object). To be used from define-page handler. Example:
(cond-expand (chicken-4 (use awful)) (chicken-5 (import awful))) ;; / -> /foo (define-page "/" (lambda () (redirect-to "/foo"))) (define-page "/foo" (lambda () "foo"))
The example above shows a redirection from / to /foo. Redirections can also be performed when the origin path is a regular expression:
(cond-expand (chicken-4 (use awful)) (chicken-5 (import awful))) ;; /bar.* -> /foo (define-page (regexp "/bar.*") (lambda (_) (redirect-to "/foo"))) (define-page "/foo" (lambda () "foo"))