301 Redirect Generator
Build 301 redirects for Apache, Nginx, Netlify, Vercel, Cloudflare, Next.js, IIS and CSV. Paste bulk URLs, validate chains and duplicates, and copy ready rules.
Redirects
0 rulesUsed only for Force HTTPS and www handling. Leave empty if you only need path redirects.
Common redirects (optional)
Custom redirects
One mapping per row. Source is the old path, destination is the new location.Tip: type full URLs or paths that start with /. Use the status to choose 301 (permanent, passes SEO value) or 302, 307, 308 for temporary or method-preserving moves.
Bulk import
You can also drag and drop a CSV file onto this panel. Each old URL must match a new URL on the same line. Empty lines are ignored.
Generated rules
.htaccess
Apache rules go in the .htaccess file above the WordPress block. Nginx rules go inside the server block and need nginx -t and reload. Netlify uses _redirects, Vercel uses vercel.json, Cloudflare uses Redirect Rules, Next.js uses next.config.js, IIS uses web.config.
On this page
A 301 redirect tells browsers and search engines that a page has moved permanently. This generator builds correct redirect rules for Apache, Nginx, Netlify, Vercel, Cloudflare, Next.js, IIS, and CSV from the same source and destination list, so you can deploy the same migration on any stack without hand-writing server syntax.
What you provide and what the tool generates
Each redirect needs a source (the old path like /old-page or /blog/old-post) and a destination (the new path or full URL like /new-page or https://example.com/shop/new). Choose a status per row: 301 for permanent moves that pass ranking value, 302 for temporary moves, 307 to keep the request method temporarily, or 308 to keep the method permanently. The tool also generates common site-wide rules: Force HTTPS, www to non-www or the reverse, enforce or remove trailing slashes, and an HSTS header when HTTPS is settled. Add your canonical domain above to make those host-based rules accurate.
Options before you generate
- Canonical domain fills in the host for HTTPS and www rules. Leave it empty if you only need path redirects.
- Force HTTPS adds a rewrite that sends all http requests to https. Tick Behind Cloudflare or proxy to use
X-Forwarded-Protoinstead ofHTTPSand avoid a loop. - www handling creates a single host redirect for www to non-www or non-www to www, with the dot escaped so it cannot match a look-alike domain.
- Trailing slash adds a rule to enforce or remove the final slash on URLs, skipping real files and directories where appropriate.
- Add HSTS header emits the Strict-Transport-Security header for Apache or Nginx. Enable it only after HTTPS is working, because browsers cache it.
- Common presets are one-click chips that toggle those global options and insert sample rows, so you do not have to remember the syntax.
How to generate and deploy
- Add rows with Add rule or paste a two-column bulk list (comma, tab, or space separated) in the bulk box and press Add bulk rows. You can also drag and drop a CSV file or use Upload CSV.
- Set the canonical domain if you enabled HTTPS or www handling, then pick your output format tab: Apache, Nginx, Netlify, Vercel, Cloudflare, Next.js, IIS, or CSV.
- Review warnings for duplicates, identical source and destination, loops, and possible chains where one destination matches another source. The output updates live as you type.
- Press Copy or Download to get the file with the correct name (
.htaccess,nginx.conf,_redirects,vercel.json,next.config.js,web.config, orredirects.csv) and paste it in the right place.
Where each format goes
Apache Redirect lines go in the .htaccess file above the # BEGIN WordPress block; test with a fresh browser window because 301s are cached hard. Nginx rewrites go inside the server block, then run nginx -t and reload. Netlify _redirects lives in the publish directory, Vercel vercel.json merges into the redirects array, Cloudflare expressions are pasted as Redirect Rules in the dashboard, Next.js entries go in next.config.js under async redirects(), IIS rules go in web.config, and CSV is a spreadsheet-ready export.
Examples
Example 1 – single page move
Source /old-page to /new-page with 301 on Apache produces Redirect 301 /old-page /new-page. On Netlify the same row becomes /old-page /new-page 301, and on Vercel it becomes { "source": "/old-page", "destination": "/new-page", "permanent": true }.
Example 2 – bulk migration with HTTPS
Add two rows: /blog/old-post to /news/new-post and /products/widget-v1 to https://example.com/shop/widget, enable Force HTTPS, and set domain example.com. Apache output starts with a RewriteEngine On block that checks %{HTTPS} off and redirects to https://%{HTTP_HOST}%{REQUEST_URI}, then two Redirect 301 lines. Nginx output puts those two mappings as rewrite ^/blog/old-post$ /news/new-post permanent; inside a 443 server block.
Example 3 – CSV upload for a shop move
Upload a CSV with rows /category/old,/category/new and /out-of-stock,/in-stock. Choosing the CSV tab returns Old URL,New URL,Status followed by quoted rows and the chosen status. Choosing Cloudflare shows (http.request.uri.path eq "/category/old") -> 301 redirect to "/category/new" status 301 per rule. Validation flags a duplicate source and a warning when you select 302 for a permanent move, suggesting 301 for SEO.
Use 301 where the old URL will never return, and 302 or 307 only for genuinely temporary detours like maintenance or A/B tests. Redirect directly to the final destination to avoid chains, delete old rules when you restructure, and always keep a backup before pasting server files.