Htaccess Redirect Generator


1. Select redirect type





2. Enter your domain name


Do not include www. Domain name only - e.g. yourdomain.com

3. Get your code


4. Copy the code to your .htaccess file



About Htaccess Redirect Generator

Generate the correct .htaccess code for 301 redirects, WWW to non‑WWW, and HTTPS redirects without touching a messy file.
Real‑world scenario: You’re moving from HTTP to HTTPS and need the exact redirect rule. You generate the code, paste it at the top of the .htaccess file, and all pages redirect perfectly without mixed content errors.
How to use it:

  1. Choose the redirect type (e.g., redirect to non‑www, redirect to HTTPS).
  2. Enter your domain name.
  3. Click “Generate”.
  4. Copy the code and paste it at the very top of your .htaccess file (make a backup first!).


DigitalOcean