Command Palette

Search for a command to run...

HT

htaccess Redirect Generator

Generate Apache .htaccess 301 and 302 redirect rules from a list of old-to-new URLs, plus force-HTTPS and www canonicalization directives, all in the browser.

What is an htaccess Redirect Generator?

An .htaccess redirect generator turns a list of old-to-new URL mappings into the Apache directives that perform the redirects. The .htaccess file is a per-directory configuration file that the Apache web server reads on every request, and it is the standard place to declare redirects on shared hosting where you cannot edit the main server configuration. This tool writes both the mod_alias Redirect lines used for exact paths and the mod_rewrite RewriteRule lines used for pattern matches, so you can paste the result straight into the file at your site root.

Redirects exist mostly to protect the traffic and search rankings you have already earned. When a page moves, a 301 permanent redirect sends visitors and search engine crawlers to the new address and passes almost all of the old page's ranking signals along with them; a 302 temporary redirect forwards visitors but tells crawlers the move is not permanent, so the original URL keeps its ranking. Choosing the wrong status code, or leaving a moved page to return a 404, is one of the most common ways a site quietly loses organic traffic after a redesign or migration.

Beyond page-level redirects, the generator also produces the two site-wide rules almost every site needs: forcing every request onto HTTPS, and settling on a single canonical host by either adding or removing the www prefix. Serving the same content on http and https, or on both www and non-www, splits ranking signals and can trigger duplicate-content confusion, so these rules are as much an SEO concern as a security one. Everything is assembled in your browser from the values you type, so no URLs or site data are uploaded, and the tool works offline once the page has loaded.

How to use the htaccess Redirect Generator?

  1. Add your redirects

    Enter each old path in the source field and its new path or full URL in the destination field. Add a row for every URL you need to move.

  2. Choose the status and match type

    Pick 301 for a permanent move or 302 for a temporary one, and choose an exact path or a regex pattern for each rule.

  3. Add site-wide rules (optional)

    Turn on Force HTTPS and pick a www option to canonicalize your host. These directives are placed ahead of your page redirects.

  4. Copy into .htaccess

    Generate the rules, copy or download them, and paste them into the .htaccess file in your site root. Test a moved URL before you rely on it.

Key Features

  • 301 and 302 Redirects

    Set each rule to a permanent 301 or a temporary 302, so ranking signals move or stay exactly as you intend.

  • Exact and Pattern Rules

    Redirect a single path with mod_alias Redirect, or match many URLs at once with a mod_rewrite RewriteRule pattern.

  • Force HTTPS

    Add the standard rule that upgrades every HTTP request to HTTPS, placed first so later host rewrites also land on https.

  • www Canonicalization

    Add or remove the www prefix with one setting to consolidate your site on a single canonical host.

Frequently Asked Questions

A 301 is a permanent redirect: it tells browsers and search engines the page has moved for good and passes almost all of the old URL's ranking signals to the new one. A 302 is a temporary redirect: it forwards visitors but signals that the original URL should keep its ranking and may return. Use 301 for permanent moves and 302 only when the change is genuinely temporary.

Comments

0 comments

0/2000 characters

No comments yet. Be the first to share your thoughts!

htaccess redirect generator301 redirect generatorhtaccess generatorapache redirectredirect 301 htaccessforce https htaccesswww redirect htaccessrewriterule generatorurl redirect generator