Skip to main content
100% Free SEO Tools No Sign Up Required
Trusted by 50,000+ SEOs Worldwide

.htaccess Redirect Generator

An .htaccess redirect generator writes Apache redirect rules for you. Enter old and new addresses, choose 301 or 302, and this free tool builds rules for single pages, folders, whole-domain moves, HTTPS and www, ready to paste into your .htaccess file. It also warns you when rules point to each other.

By ToxicBacklink – Free SEO Tools & Backlink Checker · Last updated 16 October 2026 100% In-Browser · Zero Data Retention
Interactive Client-Side Engine • 100% In-Browser Zero Server Data Retention • Privacy Protected
Server Presets & Global Rules:
Supports old,new, old -> new, old | new, or tabs

What is a .htaccess redirect generator and when should you use it?

Apache servers read redirect rules from a file named .htaccess. A redirect sends visitors and crawlers from an old address to a new one, for example after you rename a page or move to a new domain. Writing these rules by hand is easy to get wrong, because one character can change what a rule matches. Plan large moves first with the Redirect Map Checker, and if your server runs nginx, use the Nginx Redirect Generator. Writing Apache redirect rules by hand is prone to syntax errors and unintended regex loops. Before deploying rules, map your URL changes using the Redirect Map Checker and validate historical mappings with the Old vs New URL Mapping Validator. If your server infrastructure uses NGINX, generate equivalent directives with the Nginx Redirect Generator, or format large batch mappings using the Bulk Redirect Formatter. For WordPress migrations, convert redirect pairs into importable CSVs with the WordPress Redirection CSV Builder. You can also generate application-level redirect scripts via the Redirect Code Generator, organize site migrations with the SEO Migration Checklist Generator, test rewrite patterns using the Regex Tester, inspect destination URLs with the URL Parser, and compare page content with the Duplicate Content Similarity Checker.

How do you use it?

  1. Add a row for each old and new address, or paste a list.
  2. Choose 301 for a permanent move or 302 for a temporary one.
  3. Add presets such as Force HTTPS if you need them.
  4. Press Generate and read any warnings.
  5. Back up your .htaccess, paste the rules, and test a few old addresses in your browser.

Working on a comprehensive technical audit? Browse all free SEO tools to discover the next step in your workflow, or contact our technical support team if you require a specialized custom utility.

Result interpretation & practical applications

When evaluating the output of the .htaccess redirect generator, review the parsed metrics against your specific site architecture. Outputs are formatted for direct implementation into your HTML source, web server configuration, or Google Search Console audit files.

Always inspect generated values for contextual nuance. Automated tools highlight structural patterns, but manual verification confirms that technical directives align with your overarching SEO strategy.

Technical rules and limitations

  • Permanent redirects (301 and 308) tell Google the new address should be the one shown in results.
  • Temporary redirects (302, 303 and 307) keep the old address in results.
  • Server-side redirects have the best chance of being understood by Google.
  • After a move, the old address can still appear in results for a while; this is normal.

These rules come from Google's guide to redirects and Google Search. Apache's own mod_rewrite documentation explains the syntax.

Common mistakes and troubleshooting

  • Using 302 for a move that is permanent.
  • Redirecting one page to another redirected page, creating a chain.
  • Choosing both www to non-www and non-www to www, which creates a loop.
  • Pasting rules below other rewrite rules that run first.

No tool can promise how a search engine will crawl, index, or rank your pages. This tool generates and validates code against documented technical specifications; you determine where to deploy it, and you should always test changes on staging environments first. Google publishes extensive guidelines in Search Central on evaluating third-party SEO tools and advice. Learn more about our technical testing standards on our about us page, or explore full site audits on our pricing page.

Authoritative Technical Documentation & Standards

This tool executes logic aligned with official technical documentation and search engine webmaster standards:

.htaccess Redirect Generator questions

Should I use 301 or 302? ↓

Use 301 when the move is permanent and 302 when it is temporary.

Where does the code go? ↓

In the .htaccess file in your site's root folder, above other rewrite rules.

Does a redirect keep the old address in Google? ↓

After a permanent move the old address can still appear for a while. That is normal.

Is this tool free? ↓

Yes. It is completely free to use and requires no registration or subscription.

Does this tool visit my website or store my files? ↓

No. It executes entirely in your local browser runtime. Your inputs and results are never stored or logged on our servers.

Ready for the next step in your audit?

ToxicBacklink – Free SEO Tools & Backlink Checker builds fast, browser-based utilities for webmasters, developers, and SEO professionals. Each tool executes locally, shows exact modifications, and follows published specifications. Read more about us, check our how it works guide, browse all tools, or return to the home page.