Description

This function echoes the domain name or ** All Public Domains **.


We strongly recommend that you use the following UAPI function instead of this function:

Examples 




https://hostname.example.com:2087/cpsess###########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Mime&cpanel_jsonapi_func=redirectname&domain=example.com



$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Reply with domain name or ** All Public Domains **
$redirect_name = $cpanel->api2(
    'Mime', 'redirectname', 
    array(
        'domain'     => 'example.com',
  ) 
);

 



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Reply with domain name or ** All Public Domains **
my $redirect_name = $cpliveapi->api2(
    'Mime', 'redirectname',
    { 
        'domain'     => 'example.com',
 }
);

 




cpapi2 --user=username Mime redirectname domain=example.com



{
  "cpanelresult": {
    "apiversion": 2,
    "func": "redirectname",
    "data": [
      {
        "domain": "example.com",
        "url": null
      }
    ],
    "event": {
      "result": 1
    },
    "module": "Mime"
  }
}



Parameters

ParameterTypeDescriptionPossible valuesExample
domainstring

Required

The domain name.

A valid domain name.

example.com

Returns

ReturnTypeDescriptionPossible valuesExample
domain string The domain name.

The domain parameter.

1
urlstring


We deprecated this parameter in cPanel & WHM 11.


nullnull
reasonstring

A reason for failure.

This function only returns a reason value if it failed.


A string that describes the error.

This is an error message.
resultBoolean

Whether the function succeeded.

  • 1 — The function succeeded.
  • 0 — The function failed.
1