.htaccess Redirect Generator
★★★★★★★★★★4.8(0 votes)
Generate Apache .htaccess redirect rules: 301/302, www/non-www, HTTPS forcing, old domain → new domain.
.htaccess Redirect Generator
About This Tool
What This Generates
- 301 Permanent — moves a URL forever, preserves SEO
- 302 Temporary — short-term redirect
- Force HTTPS — upgrades all HTTP traffic
- www vs non-www — pick one canonical form
- Domain redirect — old domain to new domain
Important
- .htaccess is Apache only. Nginx uses different syntax.
- Always back up before editing.
Frequently Asked Questions
301 vs 302?
301 is permanent — search engines update their index and pass link equity. 302 is temporary — old URL stays indexed. Use 301 for permanent moves.
Does this work on Nginx?
No — .htaccess is Apache only. Nginx uses server block configuration with different rewrite syntax.
Will a syntax error break my site?
Yes — a bad .htaccess can return a 500 error for all pages. Always test in staging first, and keep a backup of the original.
