SN_REWRITE

NAME

sn_rewrite - This function is executed if the file is not found

DESCRIPTION

This function can be use to change the filename if the filename does not exist.

This will redirect the request to a new file if the function set_filename is called and status is set to zero.

If the status is set to a non zero value, a file not found will be return by the server

The definition for this function is in /usr/local/website/conf/project.conf where project is the project name as in

Rewrite : "/usr/local/website/sncode/extenso/functions/sn_rewrite.snc"

EXAMPLES

    request = request(); 
    request.uri; "\n";
    config = config();
    
    if request.uri st "/fr/actualites/" then
    	"redirect to index "; request;
    	set_filename("/html/pl.sn");
        set_args("seo=" .+  urlencode(request.sn_basefilename));
    	status(0);
    else
    	"redirect to 404.html";
        //set_filename("/html/fr/404.html");
    	status(-1);
    endif
 

SEE ALSO

AUTHOR

Written by Pierre Laplante

MODIFICATIONS

1.0 2014-09-09 21:24:14 laplante@sednove.com