Back to 31 more Developer Tools

Cloudflare Redirect Generator | Create Page Rules & Transform Rules

4.5(25 ratings)

Free online Cloudflare redirect generator. Create Page Rules, URL forwarding rules, and Transform Rules for your Cloudflare site. Support for dynamic redirects, bulk redirects, and Workers.

Redirect Rule 1


Understanding Cloudflare Redirects

Types of Redirects

Cloudflare offers three main ways to implement redirects:

  • Page Rules - Simple URL-based redirects with basic conditions
  • Transform Rules - Advanced bulk redirects with dynamic matching
  • Workers - Programmable redirects with full JavaScript control

Status Codes

  • 301 - Permanent redirect (best for SEO)
  • 302 - Temporary redirect
  • 307 - Temporary redirect (preserves method)
  • 308 - Permanent redirect (preserves method)

Special Features

  • Query String Preservation - Keep URL parameters in redirects
  • Path Suffix Preservation - Maintain URL path components after wildcards
  • Conditions - Apply rules based on country, device, or IP
  • Dynamic Matching - Use wildcards and patterns to match URLs

Common Patterns

Here are some common redirect patterns:

  • example.com/old → example.com/new - Simple redirect
  • example.com/blog/* → blog.example.com/* - Subdomain migration
  • http://* → https://* - HTTPS upgrade
  • *.old.com/* → *.new.com/* - Domain migration

Best Practices

  • Use Page Rules for simple, specific redirects
  • Use Transform Rules for bulk redirects with patterns
  • Use Workers for complex logic or dynamic redirects
  • Monitor your rule usage limits
  • Test redirects thoroughly before implementing
  • Document your redirect strategy

Frequently Asked Questions

What are Cloudflare redirects?

Cloudflare redirects are rules that let you forward traffic from one URL to another. They can be implemented using Page Rules, Transform Rules, or Workers. Page Rules are best for simple redirects, Transform Rules for bulk redirects, and Workers for dynamic redirects requiring custom logic.

What's the difference between Page Rules and Transform Rules?

Page Rules are simpler to set up and ideal for specific URL redirects, but you're limited to 125 rules (Enterprise plan). Transform Rules are more powerful, support bulk redirects with dynamic matching, and have a higher limit, but they're only available on Business and Enterprise plans.

What types of redirects can I create with this tool?

Our tool supports all Cloudflare redirect types including permanent (301) and temporary (302) redirects, URL forwarding, path forwarding, wildcard redirects, and dynamic redirects. You can generate configurations for Page Rules, Transform Rules, or even Worker scripts.

How do I implement these redirects on my Cloudflare site?

For Page Rules, go to your Cloudflare dashboard > Rules > Page Rules and add the generated rules. For Transform Rules, go to Rules > Transform Rules. For Workers, you can copy the generated code to a new Worker in your Cloudflare dashboard.

Can I use wildcards and dynamic matching in redirects?

Yes, Cloudflare supports wildcards (*) in Page Rules and more advanced pattern matching in Transform Rules. You can use these to match multiple URLs with a single rule. Workers provide the most flexibility with full JavaScript-based matching.

What are the best practices for Cloudflare redirects?

Use 301 redirects for permanent changes, keep rules organized from specific to general, use Transform Rules for bulk redirects, monitor your rule usage limits, and test thoroughly before implementing. Also consider using Workers for complex redirect logic.