Toolnova
SEO Tools

Htaccess Redirect Generator

Create Apache .htaccess redirect rules for 301 permanent and 302 temporary redirects — fill in source and destination paths, then copy or download the ready-to-use rewrite rules.

  • 100% free
  • No signup
  • Private — in your browser
  • No watermark
Live tool · runs in your browser
Highlights

Why use Htaccess Redirect Generator?

  • Generate multiple 301 and 302 RewriteRule directives in a single session
  • Automatic regex escaping prevents common .htaccess syntax errors
  • Download a ready-to-upload .htaccess file or copy the rules directly
  • 100% free and private — all processing runs in your browser
Overview

About Htaccess Redirect Generator

When you move pages, restructure URLs, or change domains, search engines and users following old links need to be directed automatically to the new location. Apache .htaccess RewriteRule directives handle this at the server level before the request even reaches your application. A 301 redirect tells search engines the move is permanent and transfers link equity, while a 302 tells them the move is temporary. Getting the code right the first time avoids crawl errors and lost rankings.

This free generator takes care of the RewriteRule syntax for you. Enter your from-path and destination URL for each redirect, choose 301 or 302, and the tool instantly produces properly escaped RewriteRule lines. Everything runs inside your browser — no URLs are sent anywhere. Download the finished .htaccess snippet and paste it into your existing file or upload it as a new one.

Step by step

How to use Htaccess Redirect Generator

  1. 1

    Add your redirect rows

    Enter the source path (e.g. /old-page) and the destination URL for each redirect you need.

  2. 2

    Choose the redirect type

    Select 301 for permanent redirects (recommended for SEO) or 302 for temporary ones.

  3. 3

    Copy or download

    Copy the generated rules and paste them into your .htaccess file, or download a standalone .htaccess file.

FAQ

Frequently asked questions

What is the difference between a 301 and 302 redirect?

A 301 is a permanent redirect. Search engines transfer most of the original page's link equity to the new URL and update their index. A 302 is temporary — search engines keep the original URL in their index. Use 301 for URL migrations and 302 for short-term redirects.

Does mod_rewrite need to be enabled for these rules to work?

Yes. The generated rules use RewriteEngine On and mod_rewrite directives. Most shared Apache hosting environments have mod_rewrite enabled by default. If it is not, ask your hosting provider.

Can I redirect an entire old directory to a new one?

Yes. Enter the old directory path as the From path (e.g. /old-blog) and the new URL as the destination. The RewriteRule will match that exact path. For wildcard directory redirects you may need to adjust the regex manually.

Where should I place the .htaccess file?

Upload it to your website's root directory (public_html or www). If you already have an .htaccess file, paste the generated rules at the top, below any existing RewriteEngine On line.

Will these redirect rules affect my whole website?

Only the specific From paths you define will be redirected. Other URLs are unaffected. Always back up your existing .htaccess file before making changes.

Related seo tools

See all seo tools

Browse more free tools

Explore every category in our toolbox.