v1

latestOpenAPI 3.0.2cPanel License2026-08-06657427.1 MB
Mime
Direct Link Protection (Hotlink)

Enable hotlink protection

This function adds hotlink protection for a site. Hotlink protection will redirect users to another URL if they navigate to a file with a specified extension, but an allowed URL did not refer them.

Important:

When you disable the WebServer role, the system disables this function.

get/Mime/add_hotlink

Query parameters

extensionsstring required

File types to hotlink protect.

Note:

To protect multiple file types, use a comma-separated list.

redirect_urlstring url required
Example:http://redirect.example.com/

The URL to which the system sends hotlinkers.

urlsstring required

The site to hotlink protect.

Note:

To protect multiple URLs, separate each URL with a newline character.

allow_null0 | 1
Example:1

Whether the domain allows hotlinks.

  • 1 - Allows.
  • 0 - Does not allow.

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_hotlink",
  "module": "Mime",
  "result": {
    "status": 1
  }
}