Preserve pathname when adding query argument