Htaccess Redirect Generator
Generate 301/302 redirects in bulk plus common recipes (force HTTPS, www, trailing slash) for Apache .htaccess or Nginx — free, built in your browser.
100% private — runs entirely in your browser. Nothing you enter is uploaded or logged.
Use 301 for permanent moves (passes SEO value); 302 only for temporary ones. Test on a staging copy first — a rule that also matches the target URL creates a redirect loop. Built locally; nothing uploaded.
How to use the Htaccess Redirect Generator
- Tick common recipes (HTTPS, www, trailing slash).
- Paste old-path , new-url pairs for bulk redirects.
- Choose 301 or 302 and Apache or Nginx.
- Copy the rules into your config and test.
What you can use it for
- Bulk-migrate old URLs to new ones with 301s
- Force HTTPS or a canonical www/non-www host
- Generate Apache or Nginx redirect rules
- Preserve SEO value when restructuring a site
More free tools
Optimizing your pages?
Generate meta tags, preview snippets and perfect your social cards with our free SEO tools.
Explore all free SEO tools →Frequently asked questions
What's the difference between a 301 and 302 redirect?
301 is permanent and passes SEO value to the new URL — use it for moved pages. 302 is temporary and should only be used for short-term redirects.
How do I redirect www to non-www in htaccess?
Tick the 'www to non-www' recipe — it outputs the RewriteCond/RewriteRule that forces the canonical host.
How do I force HTTPS with htaccess?
Use the 'Force HTTPS' recipe; it redirects all http requests to https with a 301.
How do I redirect an old page to a new URL?
Paste 'old-path , new-url' in the bulk box (one per line) and copy the generated Redirect/RewriteRule lines.
Why is my htaccess redirect causing a loop?
Usually the rule also matches its own target. Test on staging and make sure the destination isn't caught by the same pattern.