.htaccess Generator
Generate .htaccess rules for redirects, caching, compression and security headers.
Turn a list of old and new URLs into redirect rules.
Separate the two with a comma, tab, pipe or spaces.
Site migrations live or die on the redirect map. This tool takes a two-column list of old and new URLs and writes the rules in the syntax your server actually wants: Apache rewrite or redirect directives, nginx location or map blocks, Netlify _redirects, Vercel JSON, or Cloudflare bulk redirect format.
Before generating, it checks the map for the problems that cause outages. A redirect loop, where A points to B and B points back to A, makes a page unreachable. A chain, where A goes to B and B goes to C, works but loses a little signal and adds a round trip, so the tool offers to flatten chains so every old URL points straight at its final destination. Duplicate sources, where the same old URL appears twice with different targets, are ambiguous and get flagged.
You can choose between a 301 permanent redirect and a 302 temporary one. For a migration you almost always want 301, because it tells search engines the move is permanent and passes the ranking signal to the new address.
The 301 redirect generator is used by writers, developers, students, marketers and anyone else who needs the job done once without installing software. Common cases include:
Use 301 when the move is permanent, which is nearly always the case in a migration. It tells search engines to transfer the old address's signals to the new one. Use 302 only when the original will genuinely return, such as during a short campaign.
A chain is A pointing to B pointing to C. It works, but each hop adds latency and browsers give up after several. Flattening the map so every old URL points straight at its final destination is faster and more reliable.
The page becomes unreachable and the browser shows an error after a few hops. The tool detects loops in your map before you deploy them, which is considerably better than finding out in production.
A permanent redirect to a closely related page passes essentially all of it. Redirecting everything to the home page does not, because the destination has little to do with the original and search engines often treat such redirects as soft 404s.
At least a year, and longer if the old URLs still receive traffic or links. Removing them too early breaks every existing link to the old address.
No. It writes the rules. Test them on a staging environment before deploying, because a mistake in a rewrite rule can take a site offline.
If the 301 redirect generator is not quite what you need, these other free tools solve closely related problems.
Generate .htaccess rules for redirects, caching, compression and security headers.
Generate canonical link tags, with hreflang alternates and common-mistake checks.
Remove utm and click-tracking parameters, fragments and stray characters from URLs.
Generate robots.txt with per-crawler rules, sitemap lines and common presets.
A searchable reference for every HTTP status code, with practical guidance.