CODESALA.
Generators · Free tool

.htaccess Redirect Generator — 301, HTTPS & WWW Rules

Free .htaccess generator: create 301 redirects, force HTTPS and choose www or non-www for Apache and LiteSpeed servers. Copy tested rewrite rules instantly.

Htaccess Redirect Generator
Force HTTPS, www/non-www and 301 redirects.

No login required  |  Results in seconds

Step by step

How to use the Htaccess Redirect Generator

  1. 01Choose your rule
  2. 02Enter the from path
  3. 03Enter the to url
  4. 04Click "Run Htaccess Redirect Generator" — it's free and instant
  5. 05Review your results on screen and download the PDF/Excel report

What is the Htaccess Redirect Generator?

.htaccess is the configuration file Apache and LiteSpeed servers read for each folder. This generator writes correct mod_rewrite rules for the most common SEO jobs: forcing HTTPS, choosing www or non-www, and permanently redirecting an old URL to a new one with a 301.

Why it matters for SEO

Every site should resolve to one canonical host and protocol; otherwise search engines see up to four copies of each page (http, https, www, non-www). And when URLs change, 301 redirects preserve the traffic and backlinks the old URL earned. Rewrite syntax is unforgiving, so generated rules prevent costly mistakes.

How to read your Htaccess Redirect Generator results

Add the generated rules near the top of the .htaccess file in your site root, after RewriteEngine On, and before any CMS rules such as WordPress’s block. Keep a backup of the original file. Then test the old URLs with the Redirect Checker to confirm a single 301 hop.

Expert tips

  • Back up .htaccess before every edit — one typo can take the site down.
  • Combine HTTPS and www rules into one hop where possible.
  • Use 301 for permanent moves; avoid redirecting everything to the home page.
  • Nginx does not read .htaccess — use server blocks there.

Limitations

Output is built only from the values you enter. The tool cannot see your existing site setup, so review the result before you add it to a live site.

Why use our Htaccess Redirect Generator?

  • Completely free — use Htaccess Redirect Generator as many times as you want
  • No login or registration needed to see results
  • Download the report as PDF or Excel with a free account
  • Works on any device — desktop, tablet or mobile

Frequently asked questions

In your website’s root folder, often public_html. It is hidden, so enable “show hidden files” in your file manager.
Use a RewriteCond on HTTPS off and a RewriteRule that 301-redirects to https:// with the same host and path. The generator writes it for you.
Apache and LiteSpeed hosts (most shared hosting, including Hostinger) do. Nginx-only servers do not.
Restore your backup. A 500 error usually means a syntax error or an unsupported directive.
Yes. Htaccess Redirect Generator is 100% free with unlimited usage. You can run it as often as you like without paying anything.
No login is required to use Htaccess Redirect Generator and see your results. You only need a free account if you want to download reports as PDF/Excel or save your history.

Stay up to date with our news, ideas and updates