MADE TO BE USEFUL. A growing collection of free tools for everyday work.
SEO TOOL / REDIRECTS

Free .htaccess Redirect Generator

Generate .htaccess redirect rules for Apache: 301 and 302 page redirects, www or non-www, HTTP to HTTPS and trailing slashes. Copy the code or download a ready file.

Rules are combined to avoid double redirects, and you get clear notes on what each one does.

✓ Free to use · No signup required · Processed in your browser
Htaccess Redirect Generator workspace
CHOOSE RULES · ADD PAGE REDIRECTS · COPY THE CODE
● READY TO USE
Site-wide rules
Enter a domain like example.com (no https://).
Specific page redirects
Choose your redirect rules — the code builds as you go.
HTACCESS WORKSPACEMOSANKIT / SEO & WEBSITE TOOLS
THE BASICS

What Is an .htaccess Redirect?

The .htaccess file is a configuration file used by the Apache web server (and LiteSpeed). Adding redirect rules to it lets you send visitors and search engines from an old address to a new one — after a page move, a redesign, a domain change or when you want one consistent version of your site.

A 301 redirect tells search engines the move is permanent so they pass the old page's signals to the new one; a 302 says it is temporary.

BUILT FOR THE JOB

Key Features of MoSanKit Htaccess Redirect Generator

301

301 and 302 Redirects

Redirect individual pages permanently or temporarily, to a path or a full URL.

🔒

Force HTTPS

Send all HTTP traffic to the secure version of your site.

www

www or non-www

Pick one canonical version of your domain, combined with HTTPS in a single hop.

/

Trailing Slash Rules

Always add or always remove the trailing slash.

✓

Safe Output

Valid Apache syntax with comments, plus warnings about order and prefix matching.

◎

Private by Design

Rules are generated in your browser.

QUICK AND SIMPLE

How to Create .htaccess Redirects

01 / CHOOSE

Choose your site-wide rules

HTTPS, www or non-www and trailing slashes.

02 / PAGES

Add page redirects

One per line: the old path, then the new path or URL.

03 / COPY

Copy the code

Or download a ready .htaccess file.

04 / TEST

Back up and test

Add it to your .htaccess and check the redirects.

MADE FOR EVERYDAY WORK

Who Can Use This Tool?

SEO SpecialistsPreserve rankings during migrations.
Web DevelopersSet up canonical host and HTTPS rules fast.
Site OwnersRedirect old URLs after a redesign.
AgenciesHandle client domain and structure changes.
WordPress UsersAdd redirects without a plugin.
SysadminsStandardise redirect rules.
GOOD TO KNOW

A few things, answered.

Quick answers about using the MoSanKit Htaccess Redirect Generator.

Add them near the top of the .htaccess file in your site's root folder. On WordPress, put them above the "# BEGIN WordPress" block.

No. These rules are for Apache and LiteSpeed. Nginx and IIS use different configuration syntax.

A 301 is a permanent move — search engines transfer the old URL's ranking signals. A 302 is temporary and keeps the original URL indexed.

The Redirect directive matches the start of a path. Use specific paths, and place more specific rules before general ones.

Yes. When both are chosen they are combined into a single redirect, so visitors are not sent through two hops.

A mistake can take a site offline, so always keep a backup of the original file and test your changes immediately.

Move pages without
losing visitors.

Explore more free SEO and website tools from MoSanKit.

Explore All Tools ↗