Skip to main content
Edge Rules allow you to redirect your default b-cdn.net hostname to your custom hostname, ensuring your content is only accessible through your own domain. This is useful for:
  • SEO purposes (avoiding duplicate content)
  • Brand consistency
  • Ensuring all traffic goes through your custom domain

Prerequisites

  • A pull zone with a custom hostname already configured
  • The custom hostname should have SSL enabled

Configuration

1

Open Edge Rules

Navigate to your pull zone and select Edge Rules from the side menu.
2

Add a new rule

Click Add Edge Rule to open the rule configuration page.
3

Configure the redirect action

Select Redirect To URL as the action.In the Redirect URL field, enter your custom URL with the {{path}} variable appended:
https://cdn.yourdomain.com{{path}}
The {{path}} variable automatically includes the full request path and query string, ensuring all URLs redirect correctly.
Set the status code to 301 for a permanent redirect, or 302 for a temporary redirect.
4

Add a trigger condition

Click Add Condition and configure:
SettingValue
Condition TypeRequest URL
Match TypeMatch Any
Condition Value*://yourzone.b-cdn.net/*
Replace yourzone with the name of your pull zone.
Make sure to include both the scheme wildcard (*://) and the trailing wildcard (/*) to match all requests to your b-cdn.net hostname.
5

Save the rule

Click Save Edge Rule to activate the redirect.

Example configuration

For a pull zone named mycdn with a custom hostname cdn.example.com:
SettingValue
ActionRedirect To URL
Redirect URLhttps://cdn.example.com{{path}}
Status Code301
Condition TypeRequest URL
Condition Value*://mycdn.b-cdn.net/*

Before and after

Original URLRedirected URL
https://mycdn.b-cdn.net/images/logo.pnghttps://cdn.example.com/images/logo.png
https://mycdn.b-cdn.net/video.mp4?quality=highhttps://cdn.example.com/video.mp4?quality=high
https://mycdn.b-cdn.net/https://cdn.example.com/

HTTP vs HTTPS

Make sure to use the correct scheme in your redirect URL:
  • Use https:// if your custom hostname has SSL enabled (recommended)
  • Use http:// only if SSL is not configured
Using the wrong scheme may cause redirect loops or connection errors.