Htaccess Redirect Generator
Create 301 and 302 redirect rules for your .htaccess file without writing code.
Generate .htaccess redirects without writing code
Changing a URL without a redirect is like moving without leaving a forwarding address. Every link pointing to the old page — backlinks, bookmarks, social shares — leads to a 404 error. And every 404 means lost traffic and SEO juice.
Our generator creates 301 and 302 redirect rules for your .htaccess file with correct Apache syntax. No need to know RewriteRule syntax — fill in the fields and copy the code.
Supported redirect types
- 301 (permanent) — page moved permanently, transfers ~95% of SEO juice
- 302 (temporary) — page temporarily moved, Google keeps old URL indexed
- Page to page — /old-url → /new-url
- Entire domain — old-site.com → new-site.com
- HTTP to HTTPS — redirect all insecure traffic
How to use it
- Select redirect type (301 or 302)
- Enter source URL (old) and destination URL (new)
- Click "Generate" and paste the code into your .htaccess file at the top, before other rules
When to use 301 redirects
Site migrations, URL restructuring, page merging, duplicate fixing, page removal.
After creating redirects, verify they work with our HTTP Status Code Checker. Check HTTP headers to confirm the 301 code. For clean URLs, also use our URL Rewriting Tool. Read our complete 301 redirect guide.
FAQ
Does a 301 redirect pass all SEO juice?
Almost. Google confirmed 301 redirects pass nearly all PageRank. The slight loss is negligible compared to a 404 that passes nothing. Always set up redirects when changing a URL.
How long should I keep a 301 redirect?
As long as possible — ideally forever. Google recommends keeping redirects at least one year. Remove them too early and old links fall back to 404, losing the SEO benefit.