Content rule to block multiple URLs
This article outlines a solution for blocking multiple defined URLs and allowing all other URLs, using a single content rule.
How to block multiple specific URLs on the LoadMaster using a single content rule?
|Steps to Reproduce:|
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.
Content Rules Guide: