Description
This function lists the cPanel account's redirects.
Warning:
We strongly recommend that you use the following UAPI function instead of this function:
-
Mime::list_redirects
— This function lists the redirects in an account's.htaccess
files.
Examples
Note:
Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.
Parameters
This function does not accept parameters.
Returns
Parameter |
Type |
Description |
Possible values |
Example |
source |
string |
The part of the URL after the domain to redirect. |
A path and a document name. |
/index.html |
targeturl |
string |
The redirection destination. |
A valid URL. |
http://destination.example.com/ |
destination |
string |
The redirection destination. |
A valid URL. |
http://destination.example.com/ |
displaydomain |
string |
The domain part of the URL to redirect. |
A valid domain. |
http://www.example.com/ |
displaysourceurl |
string |
The part of the URL after the domain to redirect. |
A path and a document name. |
/index.html |
kind |
string |
The kind of redirection. |
rewrite is the only possible value. |
rewrite |
domain |
string |
The domain to redirect. |
A valid domain |
example.com |
wildcard_text |
string |
Whether the wildcard checkbox is selected. |
|
checked |
matchwww |
Boolean |
Whether the redirection handles the www. subdomain in addition to the domain. |
|
1 |
docroot |
string |
The document root for the source domain. |
A valid path. |
/home/example/public_html |
opts |
string |
The options that the function passes to Apache as part of the Rewrite Rule. |
A valid Rewrite rule. |
L |
wildcard |
Boolean |
Whether to redirect all files within a directory to the same filename in the redirected directory. |
|
1 |
urldomain |
string |
The domain to redirect. |
A valid domain. |
example.com |
sourceurl |
string |
The location that will redirect visitors. |
A valid URL. |
http://www.example.com/index.html |
matchwww_text |
string |
Whether the redirection handles the www. subdomain in addition to the domain. |
|
checked |
type |
string |
The type of redirection. |
|
permanent |
reason |
string |
A reason for failure. Note: This function only returns areason value if it failed. |
A string that describes the error. |
This is an error message. |
result |
Boolean |
Whether the function succeeded. |
|
1 |