Free • Apache .htaccess

301 Redirect Generator

Build clean 301 redirect rules for your .htaccess file. Use after URL changes, site migrations, or content reorganization.

STEP 1

Paste old → new pairs

One pair per line. Old path then new URL, space separated.

STEP 2

Choose 301 or 302

301 is permanent (preserves SEO). 302 is temporary.

STEP 3

Paste in .htaccess

Add rules to your Apache .htaccess file in site root.

Build redirects

301 vs 302 redirects — when to use which

301 is a permanent redirect. It tells Google "this page has moved forever to the new URL, transfer ranking signals." 302 is temporary — Google keeps the old URL in its index, expecting the redirect to be removed.

Common use cases

Frequently asked questions

Does a 301 redirect pass SEO ranking?

Yes, almost all of it. Google has confirmed 301 redirects pass 100% of PageRank.

Where do I put .htaccess?

In the root of your website. If using a CMS like WordPress, it usually already exists.

How long should I keep redirects?

Forever if possible. Old URLs may still be linked from external sites; removing the redirect creates broken links.

Can I redirect with PHP instead of .htaccess?

Yes, but .htaccess is faster (runs before PHP loads) and works for all file types including static files.

What if I redirect to a 404 page?

Bad. Use a 410 Gone status instead, or redirect to a relevant alternative page.