# Return .htaccess files' redirects

This function lists the redirects in an account's .htaccess files.

Important:

When you disable the Web Server role, the system disables this function.

Endpoint: GET /Mime/list_redirects
Version: 11.136.0.4
Security: BasicAuth

## Query parameters:

  - `destination` (string)
    The string with which to filter results.

 Note: 

This will only return results that match the destination parameter exactly.
    Example: "http://example.tld"

  - `regex` (string)
    A Perl regular expression that filters the results. The system matches the regular expression to the sourceurl return value.
    Example: "\"^[a-z0-9_-]{6,18}$\""

## Response 200 fields (application/json):

  - `apiversion` (integer)
    The version of the API.
    Example: 3

  - `func` (string)
    The name of the method called.
    Example: "list_redirects"

  - `module` (string)
    The name of the module called.
    Example: "Mime"

  - `result` (object)

  - `result.data` (array)

  - `result.data.destination` (string)
    The redirect's destination URL.
    Example: "http://redirect.example.com/"

  - `result.data.displaydomain` (string)
    The domain to redirect.

* ALL is the only possible value.
    Enum: "ALL"

  - `result.data.displaysourceurl` (string)
    The path to the file within the domain to test, relative to the home directory.
    Example: "/marceau.html"

  - `result.data.docroot` (string)
    The absolute file path to the source domain's document root.
    Example: "/home/example/public_html"

  - `result.data.domain` (string)
    The domain to redirect.
    Example: "example.com"

  - `result.data.kind` (string)
    The kind of redirect.

* rewrite — The request sent a redirect to another path on the server.
* redirect — The request sent a redirect for the URL.
* redirectmatch — The request sent a redirect based on a regular
expression match of the URL.
    Enum: "rewrite", "redirect", "redirectmatch"

  - `result.data.matchwww` (integer)
    Whether the redirect matches www. subdomains.
* 1 — Matches.
* 0 — Does not match.
    Enum: 1, 0

  - `result.data.matchwww_text` (string)
    Whether the [Redirect with or without www. option](https://go.cpanel.net/Redirects) is active.

 checked — The Redirect with or without www.* option is active.
    Enum: "checked"

  - `result.data.opts` (string)
    The options that the function passes to Apache as part of
the [Rewrite rule](https://httpd.apache.org/docs/2.4/rewrite/flags.html#flag_l).
    Example: "L"

  - `result.data.source` (string)
    The path to the file within the domain to test, relative to the home directory.
    Example: "/marceau.html"

  - `result.data.sourceurl` (string)
    The path to the file within the domain to test, relative to the home directory.
    Example: "/marceau.html"

  - `result.data.statuscode` (string)
    The [HTTP Status Code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) of the request
    Example: "301"

  - `result.data.targeturl` (string)
    The redirect's destination URL.
    Example: "http://redirect.example.com/"

  - `result.data.type` (string)
    Whether the redirect is permanent or temporary.

* permanent — The redirect is permanent.
* temporary — The redirect is temporary.
    Enum: "permanent", "temporary"

  - `result.data.urldomain` (string)
    The domain to redirect.
    Example: "example.com"

  - `result.data.wildcard` (integer)
    Whether the wildcard subdomains match.

* 1 — Matches.
* 0 — Does not match.
    Enum: 1, 0

  - `result.data.wildcard_text` (string)
    Whether the [Wild Card Redirect](https://go.cpanel.net/Redirects) option is active.

 checked — The Wild Card Redirect* option is active.
    Enum: "checked"

  - `result.errors` (array,null)
    List of errors if the API failed.

  - `result.messages` (array,null)
    List of messages generated by the API.

  - `result.metadata` (object)

  - `result.metadata.transformed` (integer)
    Post-processing may have transformed the data.
    Enum: 1

  - `result.status` (integer)
    * 1 — Success.
* 0 — Failed. Check the errors field for more details.
    Enum: 1, 0

  - `result.warnings` (array,null)
    List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.


