You need to enable JavaScript to run this app.
Web Application Firewall

Web Application Firewall

Copy page
Download PDF
Configure protection policy
Configure custom response page policies
Copy page
Download PDF
Configure custom response page policies
The custom interception response policy supports setting response codes and response page information to return specific information for requests that meet certain conditions (except for CC interception) to display customized information to the client.​
Notes​
Custom response for blocked requests do not apply to rate limiting rules.​
Prerequisites​
You have connected the website that needs to be protected to the WAF instance. For operations related to associate, please refer to Comparison of website association methods.​
Steps​
  1. Select the instance region in the top menu bar.​
  1. In the left navigation, select Protection Policy > Custom Reponse Page.​
  1. Turn on the custom interception response function of the domain name to be protected.​
  1. Select the domain to which you want to add the policy.​
  1. (Optional) Confirm that the protection mode of the current domain is "Protection enabled". Otherwise, click Change protection mode to modify it.​
  1. Turn on the policy switch.​
  1. Click Add Rule to configure custom intercept response parameters.​
  • ​
    Parameter​
    Note​
    Example​
    Rule name​
    Protection rule name.​
    tip​
    • Start with a letter or digit.​
    • Allow letters, digits, Chinese characters, dot “.”, underscore “_”, and hyphen “-”.​
    • The length must be between 1 and 128 characters.​
    Response Interception_1​
    Rule description​
    Fill in the relevant notes about the rules, such as the reason for adding.​
    Return specific response information​
    Request path​
    Please fill in the website path that requires protection, which can be a specific page path or all paths under the entire website.​
    • Match specific path: A specific page path, for example, to intercept access to test.com/test.html, directly fill in the path information after the domain name /test.html.​
    • Match all paths under the directory: use*to match all paths, and*must be at the end of the path.​
    • To match all paths under the entire website, fill in /*.​
    • To match all paths under a specific directory, use in the corresponding directory path*only. For example, /test/* means to match all paths under the /test/ directory.​
    warning​
    /test/*/abc.html and /test/* both match all paths under the /test/ directory.​
    /test.html​
    Enable​
    Turn on or off the current rule.​
    Keep it enabled​
    Response Code​
    Sets the response code to return when the request is intercepted.​
    405​
    Page Template​
    • System default: Select the system default template, support text/html, text/xml, application/json three page types.​
    • Customization: Fill in the custom page template, support text/html, text/xml, application/json three page types, and customize the page content.​
    • Redirect: Fill in the redirect path, such as /common/info/redirect.​
    • Page template: Custom​
    • Page type: text/html​
    • Page content: <!DOCTYPE html> <html> <meta charset="utf-8"> <body> <p> You do not have access permission, please obtain authorization and try again. </p> </body> </html>​
    Advanced conditions​
    • The request path and advanced conditions have an and relationship, which means that the rule can only be triggered when both the request path and added conditions are satisfied.​
    • Multiple Request Path Matching: If you need the rule to apply to multiple request paths, first configure the main request path to include all paths under the directory, and then add conditions matching fields as the request path. For example, if you need to configure /test/123.html and /test/abc.jpg, you can refer to the following operation:​
    1. Set the request path to /test/*.​
    1. Add 2 conditions:​
    • Condition 1: request path equals /test/123.html​
    • Condition 2: request path equals /test/abc.jpg​
    1. Set the relationship between the two conditions to OR.​
    None​
    ​
  1. Click OK to complete the rule configuration.​
  • After the configuration is complete, you can view the rule information in the list and perform rule close/open, edit and delete operations.​
Last updated: 2025.06.30 16:22:21