Content rule to block multiple URLs
Information
Summary: |
This article outlines a solution for blocking multiple defined URLs and allowing all other URLs, using a single content rule. |
Environment: |
Product: LoadMaster Version: Any Platform: Any Application: Any |
Question/Problem Description: |
How to block multiple specific URLs on the LoadMaster using a single content rule? |
Steps to Reproduce: | |
Error Message: | |
Defect Number: | |
Enhancement Number: | |
Cause: | |
Resolution: |
Below is an example syntax for a content rule that blocks the root domain URLs ($ and /), and two specific URLs (/url1 and /url2). This can be scaled up or down as required by adding more brackets () with the pipe | in between to act as an OR statement.
Rule Name: block_urls
After creating the above content rule, it is then necessary to apply it under a Virtual Service or Sub Virtual Service (SubVS) as a HTTP Selection rule under Advanced Properties. Then under the same Advanced Properties, set the Not Available Redirection Handling to 403 Forbidden and set an error message. Now test the URLs defined in the rule string above and all should return the 403 error message. Any other URL should be allowed and proceed the display the correct content. |
Workaround: | |
Notes: |
Content Rules Guide: https://support.kemptechnologies.com/hc/en-us/articles/7170469507341-Content-Rules Regex101: |