I have found that a standard .htaccess rewrite to avoid canonical issues prevents piwik from tracking referers or pageviews. This is what I put in my .htaccess file:
It works as intended except it messes up piwik. As soon as I take it out referrers and pageviews are tracked again. Anyone know of a workaround for this problem?