Htaccess Redirect Generator

Generate Htaccess Redirect.

Adding redirect rules to .htaccess

On Apache servers, the .htaccess file's Redirect directive sends visitors - and search engines - from an old URL straight to a new one. Add each old-path/new-path pair below, choose 301 (permanent) or 302 (temporary), and paste the generated lines directly into your site's .htaccess file, placed above any existing RewriteRule block.

301 vs. 302: why the choice actually matters

A 301 tells browsers and search engines the move is permanent, which causes search engines to transfer the old page's accumulated ranking signals and link equity over to the new URL - this is the right choice for a page that has genuinely moved for good, such as during a site restructure or URL-slug change. A 302 signals a temporary move instead; search engines generally keep the old URL indexed rather than transferring its signals, which is correct behavior for something like a short-term maintenance redirect, but the wrong choice if the move is actually permanent.

Why placement in the file matters

Apache processes directives from different modules - mod_alias (which provides the simple Redirect directive this tool generates) and mod_rewrite (which provides RewriteRule) - and these can conflict or produce unexpected results if ordered incorrectly. Placing simple Redirect directives near the top of the file, before any RewriteEngine/RewriteRule block, avoids that class of problem.

Common reasons to set up a redirect

A page or post has been renamed or moved to a new URL slug, an entire site has migrated to a new domain or URL structure, or an old URL has started returning a 404 that still receives real search traffic or backlinks you don't want to lose - in every one of these cases, a 301 redirect preserves that traffic and ranking value instead of letting it go to a dead end.

Frequently asked questions

Should I use 301 or 302?

Use 301 for permanent moves - it tells search engines to transfer the old page's ranking signals to the new URL. Use 302 only for genuinely temporary redirects, since search engines treat it as non-permanent and may keep indexing the old URL.

Where exactly do these lines go in my .htaccess file?

Place simple Redirect directives near the top of the file, before any RewriteEngine/RewriteRule block - mod_alias (Redirect) and mod_rewrite rules can conflict if ordered incorrectly.

Can I generate redirects for more than one page at a time?

Yes - click "+ Add redirect" to add as many old-path/new-path rows as you need, and the tool generates one Redirect line per completed row in a single batch.

Does a 301 redirect actually transfer my old page's SEO ranking?

It transfers most of the accumulated ranking signal over time, though search engines typically take some time to fully recognize and process the redirect - it's the standard, recommended way to preserve SEO value when a URL changes permanently.

What happens if I only fill in the old path but not the new one for a row?

That row is skipped when generating the rules - only rows with both an old path and a new path filled in produce a Redirect line in the output.

More in Technical SEO & Site Management