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.

SecurityBasicAuth
Request
query Parameters
config
required
string

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

Example: config=modsec_vendor_configs/example.conf
id
required
integer >= 1

The rule's ID.

Example: id=1234567890
Responses
200

HTTP Request was successful.

Response Schema: application/json
data
object
object
get/modsec_remove_rule
Request samples
whmapi1 --output=jsonpretty \
  modsec_remove_rule \
  config='modsec_vendor_configs/example.conf' \
  id='1234567890'
Response samples
application/json
{
  • "data": { },
  • "metadata": {
    • "command": "modsec_remove_rule",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}