latestOpenAPI 3.0.2cPanel License2026-08-106251554.3 MB

3da41671c02c

ModSecurity
Rule Settings

Remove ModSecurity rule

This function removes a rule from a ModSecurity™ configuration file.

Important:

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

get/modsec_remove_rule

Query parameters

configstring required
Example:modsec_vendor_configs/example.conf

The ModSecurity configuration file's path and filename, relative to the /usr/local/apache/conf/ directory.

idinteger required
Example:1234567890

The rule's ID.

Response

HTTP Request was successful.

dataobject

Example response

{
  "metadata": {
    "command": "modsec_remove_rule",
    "reason": "OK",
    "result": 1,
    "version": 1
  }
}