3 Redirectmod is a module allowing to define HTTP redirections from Ocsigen's configuration file. It is in beta version. Submit your bugs and feature wishes (or any enhancement/mistake in the documentation) [[site:trac|here]].
5 To use that extension, first load it from the configuration file:
7 <extension findlib-package="ocsigenserver.ext.redirectmod"/>
9 Then configure your hosts as in these examples:
11 <redirect suburl="(.*)" dest="http://my.newaddress.org/\1"/>
12 <redirect suburl="dir/(.*)\.html" dest="http://my.newaddress.org/\1.php"/>
13 <redirect fullurl="http://(.*).myserver.org/(.*)" dest="http://\1.mynewserver.org/\2"/>
15 The syntax of regular expression is PCRE's one.
16 //Warning: the syntax recently changed from {{{$i}}} to {{{\i}}}.//
18 According to the RFC of the HTTP protocol, dest must be an absolute URL. By default, the redirection is permanent. For temporary redirection, use:
20 <redirect temporary="temporary" suburl="(.*)" dest="http://www.plopplopplop.com/\1"/>
22 Old syntax was (before Ocsigen 1.2):
24 <redirect regexp="(.*)" dest="http://my.newaddress.org/$1"/>
25 <redirect regexp="dir/(.*)\.html" dest="http://my.newaddress.org/$1.php"/>
26 <redirect regexp="http://(.*).myserver.org/(.*)" dest="http://$1.mynewserver.org/$2"/>