v1

latestOpenAPI 3.0.2cPanel License2026-08-06657427.1 MB
Mime
Domain Redirection

Add redirect to domain

This function adds a redirect to a domain.

Important:

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

get/Mime/add_redirect

Query parameters

domainstring domain required
Example:example.com

The domain from which to redirect.

redirectstring url required
Example:http://example.com/

The URL to which to redirect.

redirect_wildcard0 | 1
Example:1

Whether to redirect all files within a directory to the same filename within the destination directory.

  • 1 - Redirect all files within the directory.
  • 0 - Do not redirect all files within the directory.
redirect_wwwinteger

Whether to redirect domains with or without www.

  • 2 - Redirect with www.
  • 1 - Redirect without www.
  • 0 - Redirect with and without www.
srcstring url-path
Example:/specific-page

A specific page from which to redirect.

type'permanent' | 'temp'
Example:permanent

Whether the redirect is temporary.

  • permanent
  • temp

Response

HTTP Request was successful.

apiversioninteger

The version of the API.

funcstring

The name of the method called.

modulestring

The name of the module called.

Example response

{
  "apiversion": 3,
  "func": "add_redirect",
  "module": "Mime",
  "result": {
    "messages": [
      "Htaccess Installed"
    ],
    "status": 1
  }
}