Enable or disable secure redirects

This function enables or disables secure redirects (HTTPS) for the cPanel account's domains that you specify.

Important:

To call this function, one of the following conditions must exist:

  • AutoSSL must exist on the domains for which you enable secure redirects.
  • A valid SSL certificate must exist for each domain for which you wish to enable secure redirects.
  • You must own the domains for which you wish to enable secure redirects.
SecurityBasicAuth
Request
query Parameters
domains
required
string

A comma-separated list of the cPanel account's domains for which to enable or disable secure redirects.

Important:

To enable or disable redirects for addon domains, you must pass the addon domain and its subdomain.

Example: domains=main.example,addon.example,addon.main.example
state
required
integer

Whether to enable or disable redirects for the specified domains.

  • 1 — Enable.
  • 0 — Disable.
Enum: 0 1
Example: state=1
Responses
200

HTTP Request was successful.

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object
get/SSL/toggle_ssl_redirect_for_domains
Request samples
uapi --output=jsonpretty \
  --user=username \
  SSL \
  toggle_ssl_redirect_for_domains \
  domains='main.example,addon.example,addon.main.example' \
  state='1'
Response samples
application/json
{
  • "apiversion": 3,
  • "func": "toggle_ssl_redirect_for_domains",
  • "module": "SSL",
  • "result": {
    • "data": [
      • "main.example",
      • "addon.example",
      • "addon.main.example"
      ],
    • "errors": null,
    • "messages": null,
    • "metadata": { },
    • "status": 1,
    • "warnings": null
    }
}