Htaccess Redirect Generator

Generate .htaccess rules for 301 redirects, HTTPS and www.

100% Free No sign-up Private
Redirect individual pages
.htaccess
# Generated by MintSEOPro RewriteEngine On # Force HTTPS RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # Remove www RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC] RewriteRule ^(.*)$ https://example.com/$1 [L,R=301] # Page redirects Redirect 301 /old-page https://example.com/new-page

How to Use the Htaccess Redirect Generator?

Generate .htaccess rules for HTTPS, www, trailing slashes and 301 redirects without memorising syntax.

  1. 1

    Enter your domain name.

  2. 2

    Choose your options: Force HTTPS, add or remove www, and trailing slash handling.

  3. 3

    Add any individual page redirects from an old path to a new URL.

  4. 4

    Optionally move the whole site to a new domain.

  5. 5

    Click Copy and add the rules to the .htaccess file in your site root, after taking a backup.

Benefits of Using Our Htaccess Redirect Generator

Tested rule patterns

Uses standard Apache mod_rewrite patterns used on millions of websites.

SEO friendly 301s

Permanent redirects pass ranking signals to the new URL.

Everything in one file

HTTPS, www, slashes, extensions and page redirects together, in the right order.

Free and private

Generated in your browser, no sign-up needed.

Who Can Use This Htaccess Redirect Generator?

Website owners

Move to HTTPS or a new domain without losing traffic.

SEO specialists

Set up redirects during migrations and URL changes.

WordPress users

Fix duplicate www and non-www versions.

Developers

Generate correct rules quickly on Apache servers.

Frequently Asked Questions

Everything you need to know about the Htaccess Redirect Generator.

What is an .htaccess file?

.htaccess is a configuration file used by Apache web servers, and by LiteSpeed which supports the same rules. It controls things like redirects, security and caching for the folder it is placed in, usually the root of your website.

What is the difference between a 301 and 302 redirect?

A 301 redirect means the page has moved permanently, so search engines transfer ranking signals to the new URL. A 302 is temporary and tells search engines to keep the old URL indexed. Use 301 for almost all SEO purposes.

Will these rules work on Nginx?

No. Nginx does not read .htaccess files and uses its own configuration syntax. These rules are for Apache and LiteSpeed servers, which most shared hosting providers use.

My site shows an error after adding the rules. What should I do?

Restore your backup of .htaccess right away. A 500 error usually means a typo, a conflicting rule, or that mod_rewrite is not enabled. Add rules one block at a time and test after each change.

All SEO Tools