Htaccess Redirect Generator🔒 100% local
Apache redirect rules. Privacy-first, no server uploads, no tracking.
Related Tools
Turns a list of redirects, one per line as /old, /new[, code], into Apache .htaccess directives. Pairs whose destination is a path become anchored RewriteRules inside an IfModule block so query strings survive, while a full-URL destination becomes a plain Redirect line. The accepted codes are 301, 302, 307, 308 and 410, defaulting to 301. It prints text for you to paste and never contacts a server.
How to use it
- Put one rule per line: /old-page, /new-page, 301. The status code is optional.
- Press Process.
- Copy the block into .htaccess, then confirm it on the live site with curl -sI https://yourdomain.com/old-page | head -3.
Worked example
/old-page, /new-page, 301becomesGenerated 1 redirect rule(s) for .htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^old-page$ /new-page [R=301,L]
</IfModule>After this block the output explains each status code, reports that no redirect chain was found, and offers an optional force-HTTPS and trailing-slash section plus the curl check.
/old-page, https://new.example.com/new-pagebecomesGenerated 1 redirect rule(s) for .htaccess:
Redirect 301 /old-page https://new.example.com/new-pageA full-URL destination skips the rewrite block entirely, so no IfModule wrapper is printed around it.
When to use it
- Restructuring a site and pointing every retired URL at its replacement before the old pages are deleted.
- Moving a single path to a different domain and needing Apache syntax rather than a plugin setting.
- Untangling inherited redirect chains, where old URLs point at URLs that themselves redirect.
What it does not do
- A path-to-path rule is anchored (RewriteRule ^old-page$), so it matches that path exactly and nothing below it. Moving a whole directory needs one rule per URL or a wildcard you write yourself.
- The escaping helper only escapes dots and slashes, so a path containing +, ? or parentheses is emitted raw and can change what the pattern matches.
- Nothing is verified. The tool does not know whether mod_rewrite is enabled, whether an existing rule already claims the path, or whether your host reads .htaccess at all, so check the response headers after uploading.