BYTETOOLS

Htaccess Redirect Generator

Generate Apache .htaccess 301 and 302 redirect rules from old-to-new path rows, plus one-click force HTTPS and force www or non-www canonicalization.

Redirect 1

.htaccess

What is the Htaccess Redirect Generator?

The Htaccess Redirect Generator builds Apache . htaccess redirect rules from a simple list of old and new paths.

  • Unlimited old-to-new redirect rows
  • 301 permanent or 302 temporary per configuration
  • One-click force HTTPS rule
  • Force www or force non-www canonicalization
  • Copy or download a ready-to-use .htaccess
  • Fully client-side and free

How to use the Htaccess Redirect Generator

  1. 1

    Add a row for each old path and the new path it should point to.

  2. 2

    Choose 301 for permanent moves or 302 for temporary ones.

  3. 3

    Optionally enable Force HTTPS and pick a www or non-www preference.

  4. 4

    Copy the generated rules or download the .htaccess file.

  5. 5

    Place the file in your site root and test the redirects in a browser.

About the Htaccess Redirect Generator

The Htaccess Redirect Generator builds Apache .htaccess redirect rules from a simple list of old and new paths. Add a row per redirect, choose 301 permanent or 302 temporary, and the ready-to-paste rules are generated live, so migrating URLs no longer means hand-writing mod_rewrite syntax.

One-click options add the site-wide rules SEOs need most: force HTTPS and enforce a single www or non-www hostname. Getting these canonicalization redirects right prevents duplicate content and consolidates your ranking signals onto one preferred URL.

The tool runs entirely in your browser and the result downloads as a .htaccess file. It is built for developers and site owners on Apache hosting who are migrating pages, fixing broken links, or cleaning up their URL structure.

Frequently asked questions

What is the difference between a 301 and 302 redirect?

A 301 is a permanent redirect that tells search engines the page has moved for good and passes ranking signals to the new URL. A 302 is temporary and signals the original will return, so it generally keeps indexing on the old URL. Use 301 for site migrations and permanent URL changes.

Where do I put the .htaccess file?

Place it in the root directory of your website, the same folder that contains your main index file. Rules apply to that directory and everything beneath it. The filename must be exactly .htaccess with the leading dot and no extension.

Do 301 redirects affect SEO rankings?

301 redirects pass the large majority of ranking signals to the destination URL, so a correctly implemented redirect preserves most of your SEO value during a migration. Avoid long redirect chains, and point each old URL directly to its final destination.

How do I force HTTPS in .htaccess?

You add a RewriteCond that checks whether HTTPS is off and a RewriteRule that redirects to the https version of the requested URL. This generator adds that rule automatically when you enable Force HTTPS, ensuring every visitor lands on the secure version.

Should I choose www or non-www?

Either works for SEO as long as you pick one and redirect the other to it. Consistency is what matters — serving your site on both www and non-www without a redirect creates duplicate URLs. Choose your preferred version and enforce it site-wide.

Guides for Htaccess Redirect Generator

Related tools