Remove trailing query part from URL