Correct referrer when canonicalising URIs