↪️ Free Technical SEO Tool

Free .htaccess Redirect Generator

Generate Apache redirect rules for 301, 302, 307 and 308 redirects, HTTPS migrations, www preferences, bulk URL changes and custom rewrite patterns.

301 & 302 redirects Bulk rules HTTPS redirects Copy & download
↪️

Build Apache Redirect Rules

Configure redirects and generate .htaccess code

Used by HTTPS and www/non-www redirect presets.

Redirect Rules

Add source and destination paths

Bulk Redirect Import

Enter one redirect per line using source | destination.

0 redirect pairs detected

Common Redirect Rules

Enable common Apache redirect patterns.

301

Permanent Redirects

Generate 301 and 308 permanent redirect rules.

302

Temporary Redirects

Create 302 and 307 temporary redirect rules.

🔒

Force HTTPS

Generate HTTP to HTTPS redirect rules.

📚

Bulk Redirects

Import multiple source and destination pairs.

Simple Process

How to Generate .htaccess Redirects

Build Apache redirect rules in three simple steps.

1

Add Redirects

Enter source paths and destination URLs manually or in bulk.

2

Choose Rule Options

Select redirect status, matching mode and common presets.

3

Copy or Download

Review the generated code before adding it to .htaccess.

Apache Redirect Guide

What Is an .htaccess Redirect Generator?

An .htaccess Redirect Generator creates Apache server configuration rules that redirect visitors and requests from one URL to another. Instead of manually writing redirect directives or mod_rewrite expressions, you can configure source paths, destinations and redirect status codes through a browser-based interface.

Redirect rules are commonly used during website migrations, URL restructuring, HTTPS transitions, domain changes, content consolidation and removal of outdated pages.

Basic 301 Redirect Example

RewriteEngine On

RewriteRule ^old-page/?$ https://example.com/new-page/ [R=301,L]

301 Redirects

A 301 status code represents a permanent redirect. It is commonly selected when an old URL has permanently moved to a new location, such as during a site migration or permanent page replacement.

301 Example
RewriteRule ^old/?$ /new/ [R=301,L]

302 Redirects

A 302 status code represents a temporary redirect. It can be useful when a destination change is temporary rather than a permanent replacement.

302 Example
RewriteRule ^offer/?$ /temporary-offer/ [R=302,L]

HTTP to HTTPS Redirects

A force-HTTPS rule redirects requests made over HTTP to an HTTPS version of the requested URL. The generator includes a preset for producing a common mod_rewrite pattern.

HTTPS Example
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

WWW and Non-WWW Redirects

Some websites prefer a hostname beginning with www, while others prefer the bare domain. Redirect rules can consistently send requests to the selected hostname format.

WWW Version
www.example.com
Non-WWW Version
example.com

Redirect Directive vs mod_rewrite

Apache environments can support different mechanisms for redirects. Simple Redirect directives can be useful for straightforward path mappings, while mod_rewrite supports more flexible conditions and pattern-based rules.

Redirect Directive

Redirect 301 /old/
https://example.com/new/

mod_rewrite

RewriteRule ^old/?$
/new/ [R=301,L]

Common Redirect Use Cases

Website Migrations

Map old URLs to corresponding locations on a redesigned website.

URL Structure Changes

Redirect legacy paths after changing page or directory structures.

HTTPS Migration

Redirect HTTP requests to HTTPS versions.

Content Consolidation

Send outdated pages to replacement or consolidated content.

Important Server Configuration Note

Review and test generated rules before deploying them. Incorrect redirect rules can cause redirect loops, inaccessible pages or unexpected URL behavior. Keep a backup of your existing .htaccess file before changes.

Who Can Use This Redirect Generator?

This tool can help SEO professionals, developers, website owners, agencies, migration teams, content managers and technical marketers prepare Apache redirect rules for review and deployment.

FAQ

.htaccess Redirect Generator FAQs

An .htaccess redirect is an Apache server rule that sends requests from one URL or pattern to another destination.
A 301 redirect represents a permanent move, while a 302 redirect represents a temporary redirect.
Yes. Enable the Force HTTPS preset to generate a common Apache mod_rewrite pattern.
Yes. Enter multiple source and destination pairs in the Bulk Import tab.
Placement depends on your Apache hosting configuration. Review existing rules and server requirements before editing an .htaccess file.
Yes. The .htaccess Redirect Generator is free to use online.

Generate Apache Redirect Rules

Configure redirect mappings and common URL rules, then export ready-to-review .htaccess code.

Generate Redirects →
✓ Rules copied