.htaccess Redirect Generator
Write 301 redirects, HTTPS and www rules for Apache.
Loading tool…
About .htaccess Redirect Generator
Moved a page or switched to HTTPS? Use this tool to write .htaccess rules for Apache servers. Make 301 redirects from old URLs to new ones, force HTTPS, and pick www or non-www for your domain.
How to use .htaccess Redirect Generator
- 1Choose HTTPS and www settings.
- 2Add old and new URLs for each redirect.
- 3Copy the code into the .htaccess file in your site root.
Why use this tool?
- Private. What you type stays in your browser.
- Free. No sign up, no limits, no watermark.
- Fast. Results in seconds, no waiting in a queue.
- Any device. Works on computers, tablets and phones.
Frequently asked questions
Is 301 or 302 better?
301 is for permanent moves and passes SEO value to the new page. 302 is only for short, temporary moves.
Where do I put the code in WordPress?
Place it above the "# BEGIN WordPress" line in .htaccess. Always keep a backup first.
Does this work on Nginx?
No, .htaccess is for Apache and LiteSpeed. Nginx uses its own config files.