Htaccess Redirect Generator (301 Rules)

Free SEO & Web Tools

Htaccess Redirect Generator


1. Choose a redirect type





2. Enter your domain name


Leave out www. Domain name only, e.g. yourdomain.com

3. Get the code


4. Copy this code into your .htaccess file



About Htaccess Redirect Generator

Redirect rules in an Apache .htaccess file send visitors and search engines from one address to another. The syntax is unforgiving, so this generator writes the rule for you.

How to use it

  1. Enter your domain.
  2. Choose the redirect type, such as non-www to www or the reverse.
  3. Copy the rule into your .htaccess file.

Test safely

Back up your .htaccess before editing, test in a private window after saving, and watch for redirect loops. If your host uses Nginx or LiteSpeed with different settings, redirects may need to be set in the server or control panel instead.





Free Micro Apps is a Justin Zwick project. See all projects. Last updated .