Guias
What is Redirect Template?
Learn about Redirect Templates and how they can simplify redirect management
Redirect Template is a pre-configured redirect rule that you can reuse when setting up redirects for multiple zones. Instead of manually creating the same redirect rules every time, you can create a template once and apply it to multiple zones using the {{zone}} placeholder that automatically replaces with the zone name.
Benefits of Using Redirect Templates
- • Save time by not creating the same redirect rules repeatedly
- • Ensure consistency across all your domains
- • Apply redirects to multiple zones at once using bulk operations
- • Use dynamic placeholders like {{zone}} for automatic zone name replacement
How to Create a Redirect Template
Step-by-step guide to create your first redirect template
Creating a Redirect Template
- Go to Configuration
Navigate to the Configuration tab in the dashboard sidebar
- Open Redirect Template Tab
Click on the 'Redirect Template' tab in the Configuration page
- Click Create Redirect Template
Click the 'Create Redirect Template' button to start creating a new template
- Fill in Template Details
Enter a name and description for your template. In the Source URL field, enter the source URL pattern. For automatic zone name replacement, use {{zone}} placeholder. For example, enter 'https://{{zone}}' which will automatically be replaced with the actual zone name when applied.
- Set Destination URL
Enter the destination URL where the redirect should point to. You can use {{zone_destination}} placeholder which will be replaced with the 'Target URL' field value when you select this template in the 'Select Redirect Template' modal. Click 'Save' to create your template.
Using Placeholders in Redirects
Learn how to use dynamic placeholders in your redirect templates
Redirect templates support two types of placeholders that automatically replace with actual values when you apply the template. This makes your templates flexible and reusable for any domain.
How Placeholders Work
When you apply a redirect template, placeholders are automatically replaced: {{zone}} with the zone name, and {{zone_destination}} with the Target URL value you enter in the 'Select Redirect Template' modal.
Where to Use Placeholders
- •In Source URL: Use {{zone}} to create source patterns like https://{{zone}} or http://www.{{zone}}
- •In Destination URL: Use {{zone}} if the destination should include the zone name
- •In Destination URL: Use {{zone_destination}} to allow custom target URLs per zone via the modal
- •Works with all redirect types: 301, 302, and other redirect status codes
How to Use Redirect Template
Learn how to apply your redirect template to zones
Using a Redirect Template
- Go to Zones Tab
Navigate to the Zones tab in the dashboard to view all your zones
- Select Zones
Select the zones you want to apply the redirect template to. You can select multiple zones for bulk operations.
- Apply Redirect Template
Use the bulk redirect operation from the bulk actions menu. Select your redirect template from the 'Select Redirect Template' modal. If your template uses {{zone_destination}}, enter the Target URL value in the modal. The placeholders will be automatically replaced: {{zone}} with each zone's name, and {{zone_destination}} with your Target URL value.
Important Note
Redirect templates work with both single zone and bulk zone operations. When applying to multiple zones, the same template will be applied to all zones with each zone's name replacing {{zone}}. Make sure to test your redirect template on a single zone first before applying to multiple zones.