&link= not redirecting (1.1.1 upgrade)

Hi fellow Piwik users,

Until my upgrade to Piwik 1.1.1 (from 1.0) I was using link-tracking to track the effectiveness of my newsletters and redirects.
I would typically sent links like


This independence from Javascript was very practical as most of the time I’m referring people to websites that are not in my own administration.

In Piwik 1.1.1 the links don’t redirect anymore, but only give blank 1×1 GIF.
Is there a way to get my tracking back on track?

Thanks in advance,


Edit: pressed ‘save changes’ by accident. Finished my message!

I just found the debug-mode.
As confirmed by previous tests (not mentioned in my first post) the visits are properly recorded tough not redirected.

With the debug-mode on, it’s visible that Piwik properly understands the request.

Here is my sample request:


or, split up:


The output can be found on this page: http://pastehtml.com/view/1cqykca.html.

You can write a proxy, e.g.,

	include '/path-to-/piwik.php';
	ob_get_clean(); // this discards the HTTP response and image returned

	// do your redirect here
	header("Location: " . $YOUR_URL_HERE );


p.s. the redirect parameter was deprecated and undocumented, and finally, removed in 1.1.

My redirect.php (in the same folder as piwik.php):

 * Fall-back for the removed redirect function of Piwik.
 * See http://forum.piwik.org/read.php?2,71128,71154 .

if(!empty($_SERVER['QUERY_STRING']) AND (!empty($_REQUEST['link']) OR !empty($_REQUEST['download']))) {
  require './piwik.php';
  ob_get_clean(); // Discard the HTTP response and image returned

  // Determine new link
  $sURL = (!empty($_REQUEST['link']) ? $_REQUEST['link'] : $_REQUEST['download']);

  // Redirect
  header('HTTP/1.1 303 See Other');
  header('Content-Type: text/html; charset=UTF-8');
  header('Location: '.$sURL);
  echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">'.PHP_EOL.
  '<p>See <a href="'.htmlentities($sURL).'">'.htmlentities($sURL).'</a>.</p>'.PHP_EOL.

  header('HTTP/1.1 500 Internal Server Error');
	header('Content-Type: text/html; charset=UTF-8');
  echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">'.PHP_EOL.
       '<html><head><title>Redirect error</title></head><body>'.PHP_EOL.
  '<p>The server couldn\'t understand your request.</p>'.PHP_EOL.


The cross-site referencing problem (that was probably the reason for deletion) stays in tact this way! More checks (to prevent this) could be added easily.