Redirect Generator (.htaccess & Nginx)
Create 301 redirect rules for Apache .htaccess and Nginx, including HTTPS and www.
About the Redirect Generator (.htaccess & Nginx)
When a URL changes, a 301 redirect sends visitors and search engines to the new address and transfers the old page’s ranking signals. Redirects are essential when you restructure a site, move to HTTPS, pick between www and non-www, or move to a new domain.
Choose what you need and this generator writes the rules for both Apache (.htaccess) – used by most cPanel shared hosting – and Nginx. Always back up your existing .htaccess before editing it and test a few URLs afterwards with our Redirect Checker.
Frequently asked questions
Where is my .htaccess file?
In the root folder of your website (often public_html). It starts with a dot, so enable “show hidden files” in your file manager.
Should I use 301 or 302?
301 for permanent changes, which is almost always what you want for SEO. 302 is for genuinely temporary moves.
Can redirects slow my site?
A few hundred rules are fine. For thousands, use a redirect map or handle them in your application or CDN.