BunnyCDN Support Hub

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

How to redirect your b-cdn.net hostname to your custom CDN hostname using edge rules

Edge rules allow you to easily redirect your b-cdn.net hostname to your custom hostname, making sure that your content will only be available on your own custom domain. This article will guide you on how to set it up in just a few easy steps.

1. First, open your pull zone details page and select Edge Rules in the side menu.

2. Click on the Add Edge Rule button. Which will open the Add Edge Rule page.

3. On the Add Edge Rule page, select the Redirect To URL action.

4. Into the redirect URL, enter the custom URL that you would like to redirect to and append {{path}} to the end of it. In our example, this will be https://cdn.ruletest.com{{path}}. Make sure to use the correct http/https scheme depending on your hostname configuration. The {{path}} parameter will be automatically replaced with the correct URL path during the redirect.

5. Next, we need to add a trigger condition, so click on the Add Condition button.

 

bunnycdn-edge-rule-create-redirect-1.png

 

6. Select Request URL for the condition type and make sure Match Any is selected. Next, add the trigger that will fire the edge rule. For example *://test.b-cdn.net/* where test should be replaced with the name of your pull zone. 

7. Add the edge rule and you're all set.

bunnycdn-edge-rule-create-redirect-2.png

 

1 Comments

Please sign in to leave a comment.