Htaccess Redirect Generator
The .htaccess Redirect Generator is a free online tool that creates Apache .htaccess redirect rules without requiring any knowledge of mod_rewrite syntax. Simply enter the old URL and the new destination URL, choose the redirect type, and the tool generates the exact code you need to paste into your .htaccess file.
Proper redirects are essential for SEO when you change URLs, restructure your site or move to a new domain. A 301 (permanent) redirect passes the full link equity from the old URL to the new one, preserving your rankings. Forgetting to set up redirects is one of the most costly SEO mistakes during a site migration.
Redirect Types Supported
- 301 Permanent Redirect — URL moved permanently (preserves SEO equity)
- 302 Temporary Redirect — URL moved temporarily
- 307 Temporary Redirect — HTTP/1.1 equivalent of 302
How to Generate .htaccess Redirects
- Enter the old URL path (e.g. /old-page.html)
- Enter the new URL (e.g. /new-page/ or https://newdomain.com)
- Select redirect type (301 recommended for permanent moves)
- Click Generate — copy the code into your .htaccess file
For whole-domain redirects (e.g. non-www to www), the tool generates the appropriate RewriteCond and RewriteRule block. Free, no login required.
Want to learn more? Read our complete guide: How to Create a robots.txt File for Your Website →