def _GetClearedFieldsForUrlRewrite(url_rewrite, field_prefix):
  """Gets a list of fields cleared by the user for UrlRewrite."""
  cleared_fields = []
  if not url_rewrite.pathPrefixRewrite:
    cleared_fields.append(field_prefix + 'pathPrefixRewrite')
  if not url_rewrite.hostRewrite:
    cleared_fields.append(field_prefix + 'hostRewrite')
  return cleared_fields