.htaccess Redirect Generator

Build Apache .htaccess redirect rules. Supports 301, 302, 307, wildcard patterns, regex, HTTPS enforcement, and www canonicalisation. Add rules one by one or paste a CSV.
Technical SEO Intelligence
One wrong rule in .htaccess can break the whole site. Build carefully.
.htaccess runs on every request. An unterminated regex, a missing L flag, or a wildcard that captures too much and you can be looking at an infinite redirect loop within seconds of upload. This tool generates vetted patterns and lets you preview before deploying.
Global rules
Individual redirects
Or paste a bulk CSV
Format: old_path,new_path,status_code (one per line). Status defaults to 301.
Generated .htaccess
Output

      
Next steps
For large migrations, generate your redirect map first
The Redirect Map Generator fuzzy-matches old URLs to new URLs across hundreds of entries. Export the CSV, paste it in the bulk field above, and you have the full .htaccess ready.
Frequently asked questions
What is .htaccess?
Apache's per-directory configuration file. Lets you add redirects, rewrites, caching rules, and access controls without touching the main server config.
Does .htaccess work on Nginx?
No. Nginx has its own configuration format. See the Nginx Redirect Generator tool.
Where does the .htaccess file go?
Site root directory for site-wide rules, or subfolders for folder-scoped rules.
What is Redirect vs RedirectMatch?
Redirect does literal path matching. RedirectMatch supports regex. For bulk patterns use RedirectMatch.
How do I force HTTPS?
Use RewriteCond %{HTTPS} off + RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301].
Can .htaccess slow down my site?
Yes. Apache evaluates .htaccess on every request. For high-traffic sites, move rules to the main vhost config and set AllowOverride None.
What is a 301 vs 302 in .htaccess?
R=301 is permanent. R=302 is temporary. The tool defaults to 301.
How many redirects can .htaccess handle?
Technically unlimited, practically 500 to 1000 before performance degrades. For more, use server-level rewrites or move to Cloudflare rules.
Does order matter in .htaccess?
Yes. First match wins. Place more specific rules before catch-alls.
What is mod_rewrite?
The Apache module that handles RewriteRule and RewriteCond. Must be enabled; most managed hosts have it on by default.
Can I test .htaccess changes before deploying?
Yes. Test on a staging environment first. Syntax errors break the entire site.
Free · no account

SEORCE for Chrome, Edge and Firefox

Audits the page you are on: headings, meta tags, schema, indexability, and whether AI crawlers can read it. Export the result as a PDF. Free, with no account.

It audits one page at a time and does not track AI answers. About the extension

Across the whole site

One check here. Every page in SEORCE.

This tool does one job. SEORCE Technical Suite crawls your whole site with fast and secure crawlers and ranks technical issues by impact. AutoFix applies fixes for meta tags, schema, canonical tags, image alt text, headings and internal links for orphan pages on your live site, through one script tag, and the list keeps growing.
3,000+ users · Free forever plan, no card needed