.htaccess Redirect Generator
Generate Apache .htaccess redirect rules, per-page or sitewide www/https/trailing-slash canonicalization.
Processed locally in your browser. Nothing you enter is uploaded.
- Two modes: page-by-page redirects (one row per old→new path, with a 301 or 302 choice per rule), or sitewide canonicalization.
- Canonicalization mode covers the near-universal "always redirect to https://, and to one consistent www/non-www host" rule — a different, more foundational need than mapping individual pages.
- Outputs correctly escaped `Redirect` / `RewriteRule` lines.
- Runs in your browser.
Why this is private
- Processed locally in your browser. Nothing you enter is uploaded.
- Open your browser's DevTools → Network tab while using this tool — you won't see a request carrying your input, because it never leaves your device.
- Nothing you enter is uploaded to a server or shared with us — the processing happens entirely on your device.
Overview
Generates 301/302 redirect rules for Apache's .htaccess file — either page-by-page (the standard way to redirect old URLs after a site restructure), or a sitewide canonicalization rule (force HTTPS, www/non-www, trailing-slash consistency) that almost every site needs exactly once.
How to use it
- 1Pick "Page-by-page redirects" to map specific old→new paths, or "Sitewide canonicalization" for a host/scheme/slash rule.
- 2For page-by-page: add a row per redirect and choose 301 (permanent) or 302 (temporary) per rule.
- 3For canonicalization: toggle force-HTTPS, pick a www/non-www rule, and optionally a trailing-slash rule.
- 4Copy the generated block into your .htaccess file.
Tips
- Use 301 for permanent moves so search engines transfer ranking signals to the new URL — 302 tells them the change is temporary and not to update their index.
Frequently asked questions
What people use it for
Preserve rankings after changing URLs301 every old path to its new equivalent so link equity carries over.
Force one canonical host and scheme sitewideRedirect http:// and the www/non-www variant your site doesn't use to the one canonical URL, in a single rule block.
Redirect after a domain or folder moveMap an old `/blog/` structure to a new one in bulk.
Send a legacy campaign URL somewhere currentKeep old printed or emailed links working.
Related tools
All seo toolsNginx Redirect GeneratorGenerate Nginx redirect rules, per-page or sitewide www/https/trailing-slash canonicalization.XML Sitemap GeneratorGenerate a sitemap.xml file from a list of your site's URLs, with lastmod, changefreq and priority.robots.txt GeneratorGenerate a valid robots.txt file for your site, starting from a WordPress, Shopify or other platform template.Meta Tags GeneratorGenerate title, description and Open Graph meta tags.
Ready to use .htaccess Redirect Generator?
.htaccess Redirect Generator