Free tool · Technical SEO

Htaccess redirect generator

Generate clean 301 or 302 redirect rules for Apache .htaccess or Nginx, whether you are moving a single page or pointing an entire domain somewhere new.

Apache · .htaccess
# 301 redirect: /old-page → https://example.com/new-page
Redirect 301 /old-page https://example.com/new-page
Nginx · server config
# 301 redirect: /old-page → https://example.com/new-page
location = /old-page {
    return 301 https://example.com/new-page;
}

How it works

Three steps, no signup.

1

Choose redirect type

Single URL, full domain or www and HTTPS canonicalisation.

2

Enter source and target

Add the old and new URLs and pick 301 permanent or 302 temporary.

3

Copy the rule

Paste it into your .htaccess or server config and reload.

FAQ

Htaccess Redirect Generator questions.

When should I use 301 vs 302?

Use 301 for permanent moves, which passes ranking signals to the new URL. Use 302 only for temporary redirects you intend to reverse. For SEO migrations, 301 is almost always correct.

Do redirects pass SEO value?

A 301 redirect passes the large majority of ranking signals to the destination. Chains of multiple redirects dilute this and slow the page, so redirect straight to the final URL.

Where do I put .htaccess rules?

In the .htaccess file at the root of your Apache site. The file must have mod_rewrite enabled. The generator also outputs the equivalent Nginx directive for the nginx config.

How do I redirect a whole domain?

Choose the full-domain option to send every path from the old domain to the matching path on the new one, preserving the rest of the URL. This is the standard pattern for a site move.

From the team behind Lynx

Tools find the work. Lynx does it.

Lynx is an AI agent that builds your backlinks automatically across 2,000+ directories, forums and content platforms. Monitored for 90 days. Your first link is free.