Redirect Generator
Generate server redirect rules for Apache, Nginx, Cloudflare Workers, Express.js, and Next.js from a list of old → new URL pairs.
Enter one redirect per line: /old-path /new-path
Moved permanently — passes link equity (SEO)
What is Redirect Generator?
Redirect Generator is a developer tool that produces ready-to-paste redirect rules for four popular server and platform configurations: Apache .htaccess, Nginx, Cloudflare Workers, and Next.js. Instead of looking up the correct syntax for each platform every time you need to set up a redirect, you fill in the source URL, target URL, and redirect type, then copy the generated code directly into your configuration file.
Redirects are a fundamental part of managing websites. A 301 (permanent) redirect signals to search engines that a page has moved forever, passing link equity from the old URL to the new one. This is essential when restructuring a site, migrating to a new domain, or consolidating duplicate pages. A 302 (temporary) redirect is used when a page is temporarily unavailable, during A/B testing, or when running a seasonal campaign. Using the wrong redirect type can have real consequences for SEO and user experience, so getting the syntax exactly right matters.
Each server platform has its own redirect syntax. Apache uses RewriteRule directives with RewriteCond modifiers in .htaccess files. Nginx uses return or rewrite directives in server blocks. Cloudflare Workers and Pages rules use JavaScript response construction. Next.js uses a redirects array inside next.config.js. Switching between these formats manually is error-prone, especially under deadline pressure.
This tool removes the guesswork by generating syntactically correct output for every supported platform, ready to copy and deploy.
How to Use Redirect Generator
- Enter source and target URLs
Type the old URL path you want to redirect from and the new destination URL or path.
- Select redirect type and platform
Choose 301 (permanent) or 302 (temporary), then pick your server platform: .htaccess, Nginx, Cloudflare, or Next.js.
- Review the generated rule
Inspect the ready-to-use code snippet with correct syntax for your chosen platform.
- Copy and deploy
Copy the rule and paste it directly into your server configuration file or dashboard.
Key Benefits
Get redirect rules for .htaccess, Nginx, Cloudflare, and Next.js from a single form — no syntax memorisation required.
Choosing the wrong redirect type can hurt SEO. The tool clearly explains the difference and generates the right code for each type.
Rules are generated immediately as you fill in the form, with no waiting and no server round-trips.
Generated rules follow best practices for passing link equity and avoiding redirect chains that slow down crawlers.
Frequently Asked Questions
Use 301 when a page has moved permanently — it passes SEO link equity to the new URL. Use 302 for temporary moves, such as maintenance pages or short-term campaigns, where the original URL will come back.
Yes. The tool supports wildcard patterns so you can redirect an entire directory or URL structure with a single rule, rather than adding one line per URL.
Yes. You can generate rules that force HTTP traffic to redirect to HTTPS, which is recommended for security and SEO on all modern websites.
Place the generated rules inside your .htaccess file in the root of your web server, or in the directory where the redirects should apply. Rules are read from top to bottom.