function

redirect . request_library . sncode

VERSIONlatest Redirect current request to a new URL.

REDIRECT

NAME

redirect - Redirects current request to a new URL.

SYNOPSIS

redirect ([code:integer], "url"); redirect ([code:integer], url:"url", uri:"uri");

DESCRIPTION

This function is used to redirect current request to a new url using HTTP_MOVED_TEMPORARILY or HTTP_MOVED_PERMANENTLY.

PARAMETERS

code
Specifies type of redirect by default HTTP_MOVED_TEMPORARILY.
url
Url to redirect. Full URL. This is the argument by default.

Thie case will be returned to the browser with:

HTTP/1.1 302 Found
Date: Thu, 04 Dec 2014 18:35:46 GMT
Server: Apache/2.4.7 (Unix) SedNove/Extenso/5.0.1120  OpenSSL/1.0.1e-fips
Set-Cookie: sednove=OvxmnD9jinD8e30IBtuHBB0qSPWVtB4F59Y:0NMFThCVKMEzIoy8vCkVbrSLx1V5ENyVgV2mSBMvkpq3950lg-4yDsEivK224FFIMYpp; Path=/; Expires=Thu, 04 Mar 2015 18:35:46 GMT
X-SedNove/Extenso: 5.0.1120 
Location: /fr/index.snc
Content-Length: 197
Connection: close
Content-Type: text/html; charset=iso-8859-1

 
uri
uri to redirect. Internal redirect handler within apache.

EXAMPLES

Note: In the followings examples, the _ between the { should be removed to make it work.

res={_{ redirect("http://www.sednove.com"); }}. redirect to sednove.
res={_{ %include "/includes/extenso.sn"; redirect(code:HTTP_MOVED_PERMANENTLY,"http://www.sednove.com"); }}. redirect to sednove.
res={_{ redirect(url:"http://www.sednove.com"); }}. redirect to sednove.
res={_{ redirect(uri:"/index.sn"); }}. redirect to index.sn.

AUTHOR

Written by Pierre Laplante and Caroline Laplante, <laplante@sednove.com>