How to Create a Redirect Rule
- Cloudflare dashboard → target domain
- Left menu: “Rules” → “Redirect Rules”
- Click “Create rule”
Redirect an Old URL to a New One
Condition: URI Path → equals → /old-page
Action: Static redirect → https://example.com/new-page → 301
Status Code Reference
| Code | Meaning |
|---|---|
| 301 | Permanent redirect |
| 302 | Temporary redirect |
Common Pitfalls
- Rule order matters — rules are evaluated top to bottom
- The free plan allows up to 10 redirect rules
- If “Always Use HTTPS” is enabled, an HTTP→HTTPS redirect rule is unnecessary
For more complex redirect logic that can’t be handled with rules, Cloudflare Workers Introduction gives you full flexibility with JavaScript.
Related Posts
- How to Check SSL Settings for a Custom Domain on Cloudflare
- Set Up a Custom Domain on Cloudflare Pages with Xserver
- How to Set Up Cloudflare Analytics on Your Astro Site
- How to Deploy an Astro Site to Cloudflare Pages
Recommended Services
- Fiverr - Find freelance developers and tech experts