Other Parameters

If Nothing Was Found

Add the parameter default_redirect_to where you can specify a default destination if the other criteria return an empty result. It accepts as value the ID of a post or page. If this parameter is omitted or if the post or page with this ID cannot be found, then the default destination is the home page.

Tracking

Use these parameters for tracking the redirects in your statistics. Supported are Google Analytics (utm_sourceutm_campaign and utm_medium) and Piwik Matomo (pk_campaign and pk_kwd).

Example

Redirect to the latest post that uses the tag with the ID 23 and add the campaign identifier “my_link” . If no post uses that tag, go to the post or page with the ID 12.

http://www.example.com/?redirect_to=latest&tag_id=23&default_redirect_to=12&utm_campaign=my_link

Caching

In most cases we are caching the final post for a given set of parameters. The only exception is “redirect_to=random” where we cache the entire set of posts from which we pick a random post.

The value is the cache lifetime in seconds.

There are two ways how you can turn on caching:

1. URL

Add the parameter cache to the URL.

Example

Redirect to a random post and cache the pool of posts for 120 seconds.

http://www.example.com/?redirect_to=random&cache=120

2. wp-config.php

Add the following constant definition to wp-config.php. This constant takes priority over the URL parameter.

define('CHATTY_MANGO_RUTP_CACHE', 600 );