> ## Documentation Index > Fetch the complete documentation index at: https://bunny.net/docs/llms.txt > Use this file to discover all available pages before exploring further. # Redirect b-cdn.net to Custom Hostname > Use Edge Rules to redirect your default b-cdn.net hostname to your custom CDN hostname. 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](https://bunny.net/docs/cdn/custom-hostname.md) 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}} ``` > [!NOTE] > > 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: | Setting | Value | | - | - | | **Condition Type** | Request URL | | **Match Type** | Match Any | | **Condition Value** | `*://yourzone.b-cdn.net/*` | Replace `yourzone` with the name of your pull zone. > [!WARNING] > > 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`: | Setting | Value | | - | - | | **Action** | Redirect To URL | | **Redirect URL** | `https://cdn.example.com{{path}}` | | **Status Code** | 301 | | **Condition Type** | Request URL | | **Condition Value** | `*://mycdn.b-cdn.net/*` | ### Before and after | Original URL | Redirected URL | | - | - | | `https://mycdn.b-cdn.net/images/logo.png` | `https://cdn.example.com/images/logo.png` | | `https://mycdn.b-cdn.net/video.mp4?quality=high` | `https://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. ## Related * [Custom Hostname](https://bunny.net/docs/cdn/custom-hostname.md) - Set up a custom hostname for your pull zone * [SSL Setup](https://bunny.net/docs/cdn/ssl-setup.md) - Configure SSL for your custom hostname * [Trigger Path Setup](https://bunny.net/docs/cdn/edge-rules/trigger-path.md) - Learn more about configuring trigger conditions * [Dynamic Variables](https://bunny.net/docs/cdn/edge-rules/dynamic-variables.md) - Full list of variables available in Edge Rules This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.