have pagination take the base_url into account when counting segments. Related #1319