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.

SecurityBasicAuth
Request
query Parameters
domain
required
string <domain>

The domain from which to redirect.

Example: domain=example.com
redirect
required
string <url>

The URL to which to redirect.

Example: redirect=http://example.com/
redirect_wildcard
integer
Default: 0

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.
Enum: 0 1
Example: redirect_wildcard=1
redirect_www
integer
Default: 0

Whether to redirect domains with or without www.

  • 2 - Redirect with www.
  • 1 - Redirect without www.
  • 0 - Redirect with and without www.
Example: redirect_www=0
src
string <url-path>
Default: "/"

A specific page from which to redirect.

Example: src=/specific-page
type
string
Default: "permanent"

Whether the redirect is temporary.

  • permanent
  • temp
Enum: "permanent" "temp"
Example: type=permanent
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/Mime/add_redirect
Request samples
uapi --output=jsonpretty \
  --user=username \
  Mime \
  add_redirect \
  domain='example.com' \
  redirect='http://example.com/'
Response samples
application/json
{
  • "apiversion": 3,
  • "func": "add_redirect",
  • "module": "Mime",
  • "result": {
    • "data": null,
    • "errors": null,
    • "messages": [
      • "Htaccess Installed"
      ],
    • "metadata": { },
    • "status": 1,
    • "warnings": null
    }
}