Converter Web ToolsConverter WebTools

.htaccess Redirect Generator

Create a htaccess Redirect Generator in your browser, free and instantly.

Your domain
Tick the rules you need and copy them into the .htaccess file at your site root (Apache/LiteSpeed). Don't enable both www options or both trailing-slash options at once. Always back up your existing .htaccess first. Generated in your browser.

About .htaccess redirects

This tool builds .htaccess redirect rules for Apache and LiteSpeed servers — force HTTPS, redirect www to non-www (or back), add or remove trailing slashes, and create 301 redirects for specific URLs. Tick what you need and copy the rules. It runs in your browser.

How htaccess Redirect Generator works

How to use it

  1. Enter your domain.
  2. Tick the rules you want and add any single-page redirects.
  3. Copy the rules into the .htaccess file at your site root.

How it works

Apache and LiteSpeed read directives in a .htaccess file to rewrite and redirect requests. This tool assembles the correct RewriteCond/RewriteRule and Redirect 301 directives for the common cases so you don't have to remember the syntax.

Be careful

Always back up your existing .htaccess first, and don't enable conflicting rules (both www options, or both trailing-slash options) at once. Test your site after applying changes.

Common uses

  • Force HTTPS site-wide
  • Redirect www to non-www
  • Redirect non-www to www
  • Add or remove trailing slashes
  • Create 301 redirects for old URLs
  • Fix duplicate-URL issues
  • Set a canonical host
  • Generate rewrite rules quickly

Frequently asked questions

What is .htaccess?
A configuration file for Apache/LiteSpeed that can redirect and rewrite URLs.
How do I force HTTPS?
Tick Force HTTPS and copy the generated rule into .htaccess.
Where does the file go?
In your website root directory.
Why a 301 redirect?
A 301 is permanent and passes ranking signals to the new URL.
Can I redirect single pages?
Yes — add old/new URL pairs for specific 301 redirects.
Will this work on Nginx?
No — Nginx uses a different config; these rules are for Apache/LiteSpeed.
Are my inputs uploaded?
No — rules are generated in your browser.
Is it free?
Yes — completely free with no sign-up.