Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device.
Atlassian cookies and tracking notice, (opens new window)
Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
🔍 Discover Our Product Documentation

Barracuda Web Application Firewall
Results will update as you type.
  • How to Update Your Notification Email Addresses
  • What's New in the Barracuda Web Application Firewall
  • 30-Day Evaluation Guide - Barracuda Web Application Firewall
  • Getting Started
  • Deployment
  • Services
  • Securing HTTP/HTTPS Traffic
    • Evaluation Policy and Flow
    • Smart Signatures
    • Rule Matching
    • Content-Based Rules
      • How to Add a Content Rule
      • How to Redirect Traffic to a Different Back-end Server Based on a URL Pattern
    • Security Policies
    • Allow/Deny Rules for Headers and URLs
    • Back-end SSL Server Configuration
    • How to Configure URL Encryption Rule
    • How to Create a Custom Response Page
    • How to Enable HTTP/2
    • How to Enable Client Fingerprinting
    • How to Enable WebSocket
    • How to Enable Proxy Protocol
    • Detecting website defacement using Application Layer Health Check
    • OWASP TOP 10 Web Application Threat Protection
  • Advanced Bot Protection
  • Client-Side Protection
  • API Security
  • Advanced Security
  • IP Reputation-Based Filters
  • Tuning Security Rules
  • Barracuda Active Threat Intelligence
  • Access Control
  • Traffic Management
  • Configuring User-Defined Patterns
  • Logging, Reporting and Monitoring
  • High Availability
  • Networking
  • System Administration and Maintenance
  • Certificate Management
  • Centralized Management of the Barracuda Web Application Firewall
  • Attacks Description - Action Policy
  • REST API
  • Common Web Application Attacks
  • How to Set Up Barracuda Cloud Control
  • End of Support and End of Life Information
  • Critical Vulnerabilities in Web Application
  • Barracuda Advanced Bot Protection Cloud Infrastructure Upgrade Information
  • Barracuda WAF 12.2 Firmware Hardened to Augment Security of Product Features

    You‘re viewing this with anonymous access, so some content might be blocked.
    /
    Content-Based Rules
    Published Jan 16

    Content-Based Rules

    Jan 16, 2026
    Subscribe

    In this Section

    • How to Add a Content Rule
    • How to Redirect Traffic to a Different Back-end Server Based on a URL Pattern

    Content Rule

    A website can be further partitioned based on content in the HTTP requests by creating a content rule. A content rule is a collection of one or more rules that specify a pattern in the URL or header fields of the request. For requests matching the rule, the configured content rule policies are applied. Content rules allow management of HTTP traffic flow for a web application.

    Configuring a content rule requires the following steps:

    1. Create the content rule for the target web service.

    2. Add one or more rules to define match criteria for this content rule.

    3. Configure the policies to apply to matching requests.

    You can configure settings for a content rule based on three traffic management techniques:

    • Load Balancing (only in Proxy mode) - Sets load balancing policy for the content rule. By default, the parent web service's load balancing policy is copied into the content rule. Load balancing is tied to a server group, and the content rule configuration specifies which server group to use. This allows distribution of requests based on the content type.

    • Caching - Sets caching policy for the content rule (refer to Configuring Caching and Compression). This allows selective caching based on the content type.

    • Compression - Sets compression policy for the content rule. This improves the response time for clients accessing the web service by compressing web pages with the specific content type.

    Rules are evaluated based on a key comprised of the URL, host, and an optional extended match rule in specified sequential order. In most cases, only host and URL are used to specify a rule. The Barracuda Web Application Firewall optimizes the search for the most common case by implementing a parallel search algorithm on all rules. The matching is determined by a best match algorithm where the best match is the rule with the longest matching host and URL keys. For more information, refer to Extended Match and Condition Expressions.

    Example: Content Rule for Images

    Assume that requests to a service are normally served by servers S1, S2, and S3. To direct all requests for image content from the images directory in the web server to a different set of servers, S4 and S5, do the following:

    • Use Rule for the service in the BASIC > SERVICES > Services section to create a content rule for requests matching the URL /images/* as shown below: (For detailed instructions on creating a content rule, refer to online help).


    • Add one or more servers for this content rule (S4 and S5 in this case) using the Server option under Add. Adding servers for content rules is similar to adding servers for a service. Any future requests matching /images/* will be now directed to one of the servers added to this content rule (S4, S5) instead of being sent to the servers associated with the parent service (S1, S2, S3).

    • By default, the load balancing policy of the parent service is inherited by newly added content groups. To customize the load balancing policy used by the servers for this content rule, Edit the content rule. 

    To configure caching for a content rule, create caching rules specifying file extensions and size restrictions for objects that should be cached on the Barracuda Web Application Firewall. These objects will be retrieved from the cache directly to serve future requests, rather than fetching the object content from the back-end servers.

    Content Rule_Image 2_CACHING_27Sept2017.jpg

     

    Create compression rules for a content rule, specifying what response content should be compressed by the Barracuda Web Application Firewall to improve available network bandwidth. For more information on configuring compression, see Configuring Caching and Compression.

    Related Article:
    • Rule Matching


    We value your feedback.
    If you have questions, suggestions, or feedback on our documentation, contact the Campus Product Documentation team.
    For general product inquiries or technical support, please contact the global Barracuda Support team.

    {"serverDuration": 12, "requestCorrelationId": "68fd7416abf847fb9ad8a39b142d357b"}