Redirectmod is a module allowing to define HTTP redirections from Ocsigen's configuration file. Submit your bugs and feature wishes (or any enhancement/mistake in the documentation) here.

To use that extension, first load it from the configuration file:

<extension findlib-package="ocsigenserver.ext.redirectmod"/>

Then configure your hosts as in these examples:

<redirect suburl="(.*)" dest="\1"/>
<redirect suburl="dir/(.*)\.html" dest="\1.php"/>
<redirect fullurl="http://(.*)*)" dest="http://\\2"/>

The syntax of regular expression is PCRE's one. Warning: the syntax recently changed from $i to \i.

According to the RFC of the HTTP protocol, dest must be an absolute URL. By default, the redirection is permanent. For temporary redirection, use:

<redirect temporary="temporary" suburl="(.*)" dest="\1"/>

Old syntax was (before Ocsigen 1.2):

<redirect regexp="(.*)" dest="$1"/>
<redirect regexp="dir/(.*)\.html" dest="$1.php"/>
<redirect regexp="http://(.*)*)" dest="http://$$2"/>