.htaccess Redirect Generator
Build clean Apache 301 and 302 redirect rules from old paths to new URLs — copy-and-paste ready. Free, instant and private: your data never leaves your device.
How to generate .htaccess redirect rules
- Enter the old path (e.g.
/old-page) and the new URL (e.g.https://example.com/new-page) for each move. Click + Add row for more. - Choose the redirect type — 301 permanent or 302 temporary — and the directive style (Redirect or RewriteRule).
- Click Generate rules, then Copy the output and paste it into the
.htaccessfile in your site root.
Why use a redirect generator?
When you rename pages, restructure a site, or move to a new domain, broken URLs cost you traffic and rankings. Apache redirects send both visitors and search engines to the right place, and a 301 passes most of the old page's link equity to the new one. Hand-writing .htaccess rules is error-prone — a single stray space or missing scheme can break your whole site. This generator produces correctly formatted, copy-ready Redirect and RewriteRule lines in seconds, so your migrations stay clean and your SEO stays intact.