replace root url correctly