rewrite links