Reorder optional URL component removal