Support is provided for the plugin, not for specific regular expressions. Some information is provided here, and it can also be found on the internet. It is your responsibility to create an expression that suits your needs.
A regular expression (or regex) is a group of characters used to find a pattern within a piece of text.
In the context of Redirection, a plain URL match will match exactly one URL. A regex URL can match many URLs.
In addition to matching many URLs, a regular expression can extract information from the source URL and copy it to the target URL.
A few examples may be helpful. A redirect that has the source URL /my-url
will only ever match requests for /my-url
.
A redirect that has the source URL /my-url/.*
will match requests for:
/my-url/this
/my-url/that
And so on.
The important part of /my-url/.*
is .*
. This is the regular expression part of the URL, and is equivalent to saying “match /my-url/
followed by any sequence of characters”.
Note that to enable a regular expression match in Redirection please ensure you have enabled the ‘regex’ option.