BunnyCDN Support Hub

Guides, troubleshooting and support requests to help you get started with BunnyCDN.

How to correctly set up the Edge Rule trigger path

Edge rules come with a powerful wildcard matching system in the trigger path. It will allow you to set up smart URL matching. This article provides a few tips and tricks to help you better understand the system and teach you how to properly set it up.

Query parameters are not supported

Currently, the trigger path will not match any query strings or data after the file name. Only the absolute URL path of the request will be matched. 

Matching by file extension

You can easily match a specific extension by entering *.extension as the trigger path, for example:

edge_rules_wildcard_extension_match.png

 

Matching subdomains

The wildcard * symbol can be used anywhere in the URL. This allows you to easily match all subdomains for example and alternatively match all non-subdomains, for example:

edge_rules_wildcard_subdomain.png

 

Pay attention to HTTP/HTTPS schema

The trigger path is compared as a whole, so pay attention to make sure the correct http:// or https:// is used. In addition, you could also replace this with a wildcard *:// to match both.

Be careful with the ending slashes

Due to the design of HTTP protocol, the trigger path will always contain an ending slash, even if accessing the root path of your domain. This means that if your trigger path is set to for example http://mydomain.com, this will actually never trigger the edge rule. In order to correctly detect the root path of your URL, always make sure to add an ending slash such as http://mydomain.com/.

1 Comments

  • 1
    Avatar
    ARIJIT BISWAS

    How can I add multiple value in trigger path?

    Let's say I wants to force download *.jpeg and *.png

    Do I need to create 2 separate rules? or Can I combine them in to 1 rule? if yes then I would like to know a example.

     

Please sign in to leave a comment.