To create a redirection rule go to menu "Components" -> "ReDJ" –> "Redirects", and click on “New” button. A form will be shown to entering redirection information related to the rule.
The "From URL" field must contains an "URL part" to match with any requested URL. If "Request only" is checked, then URL parts "scheme", "user", "pass", "host" and "port" will be ignored, otherwise the full requested URL will be checked. It is also possible to use Regular Expressions in "From URL" field. ReDJ supports regular expressions according to Henry Spencer's implementation:
http://dev.mysql.com/doc/refman/5.0/en/regexp.html
This option makes it possible to create complex patterns to match a bunch of URLs to redirect with just a single redirection rule.
The field "To URL" must contains the destination URL where to redirect the web browser for any requested URL that matches with the current rule. It must specify an absolute URL, starting with the "scheme" part. The "To URL" field can contains macros and placeholders to build the destination dynamically. Each macro or placeholder is evaluated after an URL matches, and its value is replaced to the macro or placeholder itself. Support of regular expressions, macros and placeholders allow to build complex URL trasformations.
The field "Skip" is optional. Like "From URL" it can contains an "URL part" and supports regular expressions, but its purpose is just the opposite. It allows to specify a condition to skip the rule and its redirect when the condition is satisfied.
The field "Skip user groups" works only for ReDJ Enterprise, and allows to select one or more user groups which skip the rule (i.e. the redirection will not be applied).
The "Redirect" field indicates the redirection type to use. There are three options available:
The Internal Redirect option is available only for ReDJ Enterprise, and allows to change the destination page returned to web browser "internally" to Joomla, on the server side. This means that the user stays on the same URL and cannot notice any changes in the address bar. The Internal Redirect option can be selected also in ReDJ Community, but in this case a standard 301 redirect will be used instead.
About the meanings of other fields:
The statistics fields provide useful information about rule usage. The "Hits" counts the number of times the rule were used, and the "Last visit" indicates the last time the rule were applied.
In the example showed in the image above, the source and the destination are:
From URL: ^/test.html
To URL: http://{siteurl}/
With this settings all the following URLs will be redirected:
http://www.mysite.com/test.html
http://www.mysite.com/test.html?param=xxx
http://www.mysite.com/test_html
While this will not be:
http://www.mysite.com/directory/test.html
This is because in the regular expression ^/test.html the initial caret ^ means "start with", and "request only" is checked, so /directory/test.html will not match. Notice that the URL with /test_html also matches, because the dot means "any char" in the regexp syntax. To specify a literal dot, this should be escaped with \, so the rule should be:
From URL: ^/test\.html
This will match only the first and the second URL of our previous example, but not the third (http://www.mysite.com/test_html).
The destination contains an example of macro, {siteurl}, which will be replaced with www.mysite.com.