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.
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.
Common Redirect Rules
Enable common Apache redirect patterns.
Permanent Redirects
Generate 301 and 308 permanent redirect rules.
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.
Add Redirects
Enter source paths and destination URLs manually or in bulk.
Choose Rule Options
Select redirect status, matching mode and common presets.
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.
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.
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.
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.
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.
Related SEO Tools
Explore More SEO Utilities
Robots.txt Generator
Create crawler directives and sitemap references.
Open Tool →XML Sitemap Generator
Create sitemap.xml files for website URLs.
Open Tool →Meta Tag Generator
Generate useful metadata for webpages.
Open Tool →SERP Preview
Preview titles and descriptions in a search-style layout.
Open Tool →FAQ
.htaccess Redirect Generator FAQs
Generate Apache Redirect Rules
Configure redirect mappings and common URL rules, then export ready-to-review .htaccess code.
Generate Redirects →