Rewrite the links