Once a URL has been matched you can perform an action, such as redirecting the user, or sending an error.
Pick the type of action from the When matched dropdown:
- Redirect to URL – redirect the user to another URL, updating the URL in the user’s browser. This is the default
- Redirect to random post – redirect the user to a randomly chosen post on your site
- Pass-through – loads another page, but keeps the current URL the same
- Error (404) – sends an error back to the user
- Do nothing – do nothing, but don’t log anything
Redirect to URL
This is the default behaviour and redirects the user to another page on your site or an external site. You can also configure the redirect code used:
Redirect to random post
This is similar to Redirect to URL, but sends the user to a randomly chosen page on your site. The page is different each time the URL is visited.
As with Redirect to URL you can select the redirect code sent, although given the random nature of the redirect you are advised to use a temporary redirect.
This behaves differently to the previous redirect actions in that the user isn’t actually redirected. Instead the server sends another page to the user, but keeps the current URL the same. In effect it passes-through (or masks) the URL with another URL
You can configure the passed-through page as follows:
This returns an error code to the user. You can configure the code as follows:
The available codes are:
- 401 – unauthorised access
- 404 – standard 404 error page and indicates the page is not currently available, but may become available in the future
- 410 – page gone and indicates the page is no longer available and won’t be available in the future
This, unsurprisingly, does nothing! The request is performed as expected, and whatever appropriate response is sent to the user. The only purpose of this action is to prevent Redirection from logging the request.
You would use this if you get a lot of 404 entries in your 404 log, and want to stop some appearing. In this instance you would create a Do Nothing action and it will no longer appear in the log.