fix links according to urlrewriting