Toolverge

.htaccess Redirect Generator

An .htaccess redirect generator produces a ready-to-paste Apache "Redirect" directive that sends visitors (and search engines) from an old URL path to a new path or full URL, with a 301 (permanent) or 302 (temporary) status code. A 301 tells a browser and a search engine that the move is permanent, which is what causes accumulated ranking signal to transfer to the new URL over time, while a 302 signals a temporary situation and deliberately withholds that transfer — using the wrong status code is a common, hard-to-notice cause of an SEO migration losing ranking it should have kept.

Redirect type

.htaccess line

Redirect 301 /old-page.html /new-page

How it works

  1. Enter the old path (must start with "/") and the new target (a path or full URL).
  2. Choose 301 (permanent) or 302 (temporary).
  3. Copy the generated line into your site's .htaccess file.

Formula Redirect <status> <old path> <new target>

Frequently asked questions

When should I use 301 vs 302?

Use 301 when the move is permanent — search engines transfer ranking signal to the new URL. Use 302 for a temporary redirect where the old URL will return, since 302s don't transfer ranking signal the same way.

Does this work on all web servers?

The "Redirect" directive is specific to Apache (via .htaccess or the main config) with mod_alias enabled — Nginx and other servers use different configuration syntax.

Can I redirect to an external site?

Yes — enter a full URL (including https://) as the new target.

Does this handle wildcard or pattern-based redirects?

No — this generates a single old-path-to-new-target redirect; pattern-based redirects need a RewriteRule with regex, which is a separate, more advanced Apache feature.

Do I need to restart Apache after editing .htaccess?

No — Apache re-reads .htaccess on every request as long as AllowOverride is enabled for that directory, so the redirect takes effect immediately after you save the file.