Modified replace to ignore anything after the third slash