Redirect Generator

Generate 301 & 302 redirect rules for Apache .htaccess and Nginx. Copy-paste ready.

Free · No sign-up · Instant results

.htaccess rules

# Generated by SEOBolt — https://seobolt.app/tools/redirect-generator
# Place this in the .htaccess file at your site root.

Redirect 301 /old-page /new-page

Why use this redirect generator?

301 & 302, done right

Pick permanent or temporary and get syntactically-correct rules every time — no guessing the right flag.

Apache + Nginx

Switch between .htaccess and Nginx config with one click. The exact same map, the correct syntax for each.

Common presets

Full-domain moves, force www / non-www, force HTTPS, and trailing-slash normalization in one click.

How to use the redirect generator

  1. 1

    Choose your server

    Select Apache (.htaccess) or Nginx so the output uses the correct syntax for your stack.

  2. 2

    Pick redirect type

    Use 301 for permanent moves (best for SEO migrations) or 302 for temporary redirects.

  3. 3

    Map your URLs or pick a preset

    Add old → new URL rows, or choose a preset like full-domain redirect, force www, or trailing-slash normalization.

  4. 4

    Copy or download

    Copy the rules into your .htaccess or Nginx server block — or download the file directly — then reload your server.

Redirect FAQ

What is the difference between a 301 and a 302 redirect?

A 301 is a permanent redirect — it tells search engines the page has moved for good and passes (almost) all link equity to the new URL. Use it when you have permanently changed a URL or merged pages. A 302 is a temporary redirect — Google keeps the original URL indexed because you are signaling the move is short-term (e.g. A/B tests, maintenance, seasonal pages). For SEO migrations, you almost always want 301.

Where does the .htaccess file live?

On an Apache server, the .htaccess file goes in the root directory of the site you want to control — usually the same folder as your homepage (often public_html, www, or htdocs). Rules apply to that directory and everything below it. The file must be named exactly .htaccess (with the leading dot and no extension), and Apache needs AllowOverride enabled for the rules to take effect.

Where do Nginx redirect rules go?

Nginx does not use .htaccess. Redirect directives go inside a server { } block in your site's configuration file, typically found in /etc/nginx/sites-available/ (symlinked into sites-enabled) or /etc/nginx/conf.d/. After editing, test the config with 'nginx -t' and reload with 'systemctl reload nginx' (or 'nginx -s reload') for changes to apply.

Do redirects hurt my SEO?

A single, correctly-implemented 301 redirect passes nearly all ranking signals and is the safe, recommended way to move content. Problems arise from redirect chains (A → B → C), redirect loops, and redirecting many pages to one irrelevant page (often the homepage), which Google may treat as a soft 404. Keep redirects direct (one hop), map each old URL to its closest new equivalent, and avoid chaining.

How do I redirect an entire domain to a new one?

Use the 'Redirect entire domain' preset. It generates a single rule that forwards every path from the old domain to the same path on the new domain (e.g. /blog/post stays /blog/post), preserving your URL structure and link equity. This is the correct approach for a full rebrand or domain change — far better than redirecting everything to the new homepage.

Related free tools

Find broken redirects before Google does

SEOBolt's technical Site Audit crawls your whole site and auto-detects redirect chains, loops, and broken redirects — so link equity never leaks. Free for 2 projects.

Run Full Site Audit Free →