Redirect Generator

Generate 301/302 redirect rules for Apache .htaccess, Nginx, and Cloudflare.

Old Path / URL New URL Type

📐 How to Use

  1. Enter the old (source) URL path and the new (destination) URL for each redirect.
  2. Select 301 (permanent) or 302 (temporary) for each rule.
  3. Choose your server type: Apache, Nginx, or Cloudflare.
  4. Copy the generated rules and add them to your server configuration.

🎯 When to Use This

  • Migrating a blog to new URL patterns, where fifty old paths need rules and typing RewriteRule fifty times invites typos.
  • Switching the same redirect list from Apache to Nginx after a hosting move, without rewriting every rule by hand.
  • Preparing a redirect map as a deliverable for a developer or host who will apply it, in the syntax their stack actually uses.
  • Retiring a handful of thin pages into their closest surviving equivalents, with the 301s written consistently rather than ad hoc.

❓ Frequently Asked Questions

QWhen should I use 301 vs 302?
Use 301 (permanent) when a page has moved for good — it passes SEO value to the new URL. Use 302 (temporary) for seasonal or testing redirects where the original URL will return.
QWhere does .htaccess go?
The .htaccess file lives in your site's document root (same folder as index.php). Add redirect rules at the top of the file, before any existing RewriteRules.
QDoes a 301 redirect lose PageRank?
Historically yes, with a small loss. Since 2016 Google has confirmed that 301 redirects pass full link equity, so the SEO impact is negligible.

ℹ️ About This Tool

A redirect is an HTTP response carrying a status in the 3xx range and a Location header pointing at another URL, which the client then requests instead. A 301 says the move is permanent and invites clients and crawlers to remember it; a 302 says the original address will be back. The rule itself lives in server configuration, which is why the same redirect is written three different ways depending on what serves the site.

This tool takes a list of old path and new URL pairs, each tagged 301 or 302, and writes them for one of three targets: Apache RewriteRule lines preceded by RewriteEngine On, Nginx rewrite directives for a server block, or a JSON array of source, destination and permanent fields. The output downloads as .htaccess, redirects.conf or redirects.json.

⚠️ Notes & Limits

  • The Apache pattern escapes only dots and question marks. Other regex characters, among them plus signs, parentheses and brackets, stay live and can overmatch.
  • RewriteRule matches the path alone, so a source with a query string will not match. That needs a RewriteCond on %{QUERY_STRING}, which this tool does not write.
  • The JSON option emits source, destination and permanent keys. Check what field names your platform's bulk-redirect importer expects, since this shape is not universal.
  • Nothing detects a chain or a loop. If one rule's destination is another rule's source, both are written out and the server will follow them in turn.