Trim webPath properly