SEO tool

301 Redirect Generator (.htaccess & Nginx)

An htaccess redirect generator that is also a 301 redirect generator and an nginx redirect generator. Exact, prefix, and wildcard rules, then copy .htaccess, Nginx, or Next.js. It all stays on your device.

Like the tool? Find a bug?Share with us

Generator

Add from → to rules, then copy .htaccess, Nginx, or a Next.js redirects() snippet. Paste an existing file to parse. Files stay on this device.

Status

Host

Redirects (1/40)

01

Supported files: .htaccess, .txt, .conf, .csv
0 / 50,000

0 301 redirects

.htaccess output will appear here.
Nginx output will appear here.
Next.js output will appear here.

Guide

How this 301 redirect generator works

01

.htaccess RewriteRule

Apache per-directory rewrites match the path without a leading slash. This generator writes RewriteEngine On and RewriteRule with [R=301,L] (or 302 / 307 / 308). Put the file in the site root.

02

Nginx return

Exact paths use location = and return 301. Prefix and wildcard rules use a regex location. Host jumps (HTTPS, www) belong in the matching server block.

03

Next.js redirects()

App Router config uses async redirects() in next.config.ts. This snippet sets statusCode: 301 so clients get a classic 301, not the 308 from permanent: true. Host-level HTTPS and www still live on Apache, Nginx, or DNS.

Use it

What to paste

From/to pairs, CSV, Redirect 301, RewriteRule, or Nginx rewrite lines. Prefix keeps the rest of the path (/blog/ → /news/). Wildcard accepts :slug and *. Input is capped at 50,000 characters and 40 rules.

FAQ

Questions

Does this upload my redirects?

No. Generating, parsing, and copy run in the browser. There is no account and no API call.

301 or 308?

301 is the SEO permanent redirect. Next.js permanent: true sends 308 so POST stays POST. This generator uses statusCode so you can pick 301, 302, 307, or 308 explicitly.

.htaccess or Nginx?

Apache and most shared hosts read .htaccess in the web root. Nginx does not read .htaccess — paste the Nginx output into a server block. Next.js on Vercel uses the Next.js snippet.

Is there a size limit?

Paste is capped at 50,000 characters and 40 rules so a huge dump cannot freeze the tab.