Tools

.htaccess Generator

Generate redirect (301) and other Apache rules from form input.

About this tool

This tool generates .htaccess redirect code in one click. Three features: 1) Enter redirect type, source URL, destination via form, 2) 301 redirect, www normalization, HTTPS redirect supported, 3) Copy generated code directly. Ideal for domain change and URL normalization.

Tool interface

  

Usage

  1. Enter redirect type, source URL, destination in the form
  2. Generated .htaccess code is displayed
  3. Copy and place in document root

When to use

Domain change 301, www normalization, HTTP→HTTPS redirect.

Examples

http→https, www→non-www, old URL→new URL redirects.

FAQ

301 vs 302?

301 = permanent (SEO passes to new URL). 302 = temporary.

Where to put .htaccess?

Document root (e.g. public_html). Applies to that directory and below.

How to write .htaccess 301?

Redirect 301 /old /new. This tool generates from form input.

Redirect HTTP to HTTPS?

Enter redirect type, source, destination in this tool. Get HTTPS redirect .htaccess.

Unify www to non-www?

.htaccess 301 from www to non-www. This tool generates the code.

Domain change redirect?

301 from old to new domain. Important for SEO pass-through. This tool generates.

.htaccess vs nginx?

.htaccess = Apache. nginx uses different config. Use .htaccess on Apache.

Prevent redirect loop?

Conditional check for HTTPS/www. This tool's output handles common cases.

How to use .htaccess generator?

Enter redirect type, source URL, destination. Copy generated .htaccess.

Multiple redirects?

Write multiple Redirect lines. Generate one per rule with this tool, combine.

Related tools