Description

This function echoes the URL or ** All Requests **.

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=redirecturlname&url=http%3A%2F%2Fwww.example.com

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Reply with URL name
$redirect_urlname = $cpanel->api2(
    'Mime', 'redirecturlname', 
    array(
        'url'     => 'http://www.example.com',
  ) 
);

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Reply with URL name
my $redirect_urlname = $cpliveapi->api2(
    'Mime', 'redirecturlname',
    { 
        'url'     => 'http://www.example.com',
 }
);

cpapi2 --user=username Mime redirecturlname url=http%3A%2F%2Fwww.example.com

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

Parameters

ParameterTypeDescriptionPossible valuesExample
urlstring

Required

The URL to pass through the function.

A valid URL.

http://www.example.com/

Returns

Return TypeDescriptionPossible valuesExample
urlstringThe url parameter.The url parameter.http://www.example.com/
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