.htaccess Redirect Generator — Free, Browser-Based | SmallStudyTools
100% Free · No Signup · Browser-Based

.htaccess Redirect Generator

Turn an old path and a new path into a ready-to-paste 301 or 302 redirect rule for Apache's .htaccess, free, right in your browser. Pro adds bulk redirect generation, Nginx syntax, wildcard redirects, and www/HTTPS boilerplate — nothing is ever uploaded.

● Pro Version is Free for now
✓ Bulk Redirect Generation · Apache & Nginx Syntax · Wildcard/Regex Redirects ·
✓ www/HTTPS Boilerplate Snippets · Duplicate & Loop Detection
Day Night
🔀 Your Redirect
Old Path or URL
The page that no longer exists, or that you're moving away from. A full URL is fine — only the path is used.
New Path or URL
Where visitors (and search engines) should land instead. Use a full URL if the destination is on a different domain.
Redirect Type
ℹ️ 301 vs 302: Which Should You Use?
301 Permanent. Tells browsers and search engines the page has moved for good. Search engines transfer the old page's ranking signals to the new URL and update their index to point at it. Use this when a page is gone for good: a permanent URL change, a merged page, or a retired product.
302 Temporary. Tells them the move is short-term, so the original URL should stay indexed. Search engines keep ranking the old URL and only show visitors the redirect. Use this for A/B tests, maintenance pages, or anything you expect to restore.
📋 Bulk Redirect Generator PRO
0 lines
One rule per line: old path, new path, and an optional 301/302 (defaults to whatever's selected above). Separate with a comma, a tab, or an arrow (-> or =>). Lines starting with # are treated as comments and skipped.
Every rule is built with plain JavaScript running in this tab. Your redirect list is never uploaded, logged, or sent to a server at any point.
🧩 Wildcard / Directory Redirect PRO
Old Directory
New Directory
Redirects everything under the old directory to the matching path under the new one, e.g. /old-category/anything → /new-category/anything. Uses the redirect type selected above.
⚡ www / HTTPS Boilerplate PRO
Your Domain
Canonical Direction
Also Force HTTPS
Adds a site-wide http → https rule to the same snippet
⚙️ Output Format PRO
Switches every rule on this page, single, bulk, and wildcard, between Apache .htaccess syntax and Nginx server-block syntax.
🔁 Duplicate & Loop Check PRO
Generate a bulk redirect block to see duplicate, conflict, and redirect-loop warnings here.

How to Use the .htaccess Redirect Generator

Paste an old path and a new path and get a ready-to-use redirect rule in seconds — everything runs in your browser, with no signup and nothing uploaded.

1
Enter Old & New Path
Type the old path or URL that no longer exists, and the new path or URL visitors should land on instead.
2
Pick 301 or 302
Choose 301 Permanent for a page that's moved for good, or 302 Temporary for a short-term redirect you plan to undo.
3
Generate & Copy the Rule
Click Generate Redirect Rule, then copy the finished line straight into your .htaccess file (or Nginx config, in Pro).
4
Switch to Pro for Bulk & Wildcard
Pro unlocks pasting a whole list of old/new pairs at once, Nginx syntax, wildcard directory redirects, and www/HTTPS snippets.
5
Check for Loops & Conflicts
After a bulk generate, Pro automatically scans your whole list for duplicate rules, conflicting targets, and redirect loops.

Everything above runs entirely in your browser using plain JavaScript. Your old paths, new paths, and any bulk list you paste are never uploaded to a server.

Specifications
Price Free
Data Processing Local only, in your browser
Redirect Types 301 Permanent & 302 Temporary
Pro Mode Options Bulk generation, Apache/Nginx syntax, wildcard/regex redirects, www & HTTPS snippets, duplicate & loop detection
Found a bug or something not working right? Let us know and we'll fix it, every report helps make this tool better.
Report an Issue

.htaccess Redirect Generator: Build a 301 or 302 Redirect Rule, Free, Right in Your Browser

Quick answer: Enter the old path, the new path, and pick 301 Permanent or 302 Temporary, and the tool writes a ready-to-paste Apache .htaccess rule. Pro Mode adds bulk generation for a whole list of redirects at once, an Apache/Nginx syntax toggle, wildcard redirects for an entire old directory, one-click www and HTTPS boilerplate, and automatic duplicate and loop detection. It's free, with no signup, and nothing is uploaded to a server.

A redirect tells a browser, and a search engine, that a page has a new address. Get it wrong and visitors land on a 404, search rankings for the old page vanish instead of transferring, or a careless rule sends traffic in a circle until the browser gives up with a "too many redirects" error. Most site owners either hand-edit an .htaccess file by copying a line from an old blog post, or reach for one of the many existing htaccess redirect generator tools that already cover this exact job, from hosting-company utilities to dedicated SEO-agency tools. This one keeps the same idea, built entirely in the browser: fill in two paths, pick a redirect type, and get back the exact line to paste.

Searches for a 301 redirect generator and an apache redirect generator turn up dozens of similar tools, and a growing number of them, alongside nginx redirect generator results, now cover both server types in one place rather than assuming every site runs Apache. This tool follows that same pattern: Simple Mode sticks to the classic Apache .htaccess line, and Pro Mode adds Nginx as a second output format for the identical rule.

1How a Single Redirect Rule Gets Built

Type the old path (or paste a full URL, the domain part is stripped automatically) and the new path, choose 301 or 302, and click Generate Redirect Rule. In Simple Mode the output is an Apache Redirect directive, the mod_alias line most hosting documentation leads with because it needs no extra Apache module configuration: Redirect 301 /old-page /new-page. In Pro Mode the same inputs can instead produce an Nginx location block using a return directive, the syntax Nginx's own documentation recommends over the older rewrite directive for a simple one-to-one redirect.

2Simple vs Pro

FeatureSimplePro
Single redirect rule from an old path and a new path✓✓
301 Permanent & 302 Temporary redirect types✓✓
Apache .htaccess output✓✓
Nginx output (location / return syntax)—✓
Bulk redirect generation from a pasted list—✓
Wildcard redirects for an entire old directory—✓
www ↔ non-www and HTTP → HTTPS boilerplate snippets—✓
Duplicate, conflict & redirect-loop detection—✓

Simple Mode covers the one-off case: a single page that moved, scored and written out in a few seconds. Pro Mode is built for the messier real-world job, a site migration or a batch of retired blog posts, where dozens of old URLs need new homes at once and a single typo can quietly break a rule or loop two pages into each other.

3Bulk Generation, Wildcards, and Site-Wide Boilerplate

Pro Mode's Bulk Redirect Generator accepts one old-path, new-path pair per line, with an optional redirect type, separated by a comma, a tab, or an arrow, the loose format real redirect spreadsheets and CSV exports tend to use. It builds the whole block in one pass rather than one line at a time, matching the bulk-redirect tools that agencies and larger sites already rely on for site migrations. The Wildcard / Directory Redirect card handles the related but different case of moving an entire old directory, like an old blog category, to a new one in a single pattern-based rule instead of writing out every individual page. The www / HTTPS Boilerplate card covers the two most common site-wide redirects: canonicalizing www to non-www (or the reverse) and forcing HTTPS, both frequent how-to searches on their own, generated as one ready-to-paste block for either Apache or Nginx.

4Common Reasons People Generate a Redirect

🔄
Migrating a Site to a New URL Structure
🧹
Cleaning Up Old or Merged Blog Posts
🌐
Switching Domains or Rebranding
🔒
Forcing HTTPS Across an Entire Site
🧪
Running a Short-Term A/B Test Redirect
🧑‍💻
Developers Fixing a Broken Link Before Launch

None of these need a developer on standby to get the syntax exactly right. An old path, a new path, and the right redirect type are enough to produce a rule that's safe to paste the same session.

5Catching Redirect Loops Before They Reach Production

A "too many redirects" error, the exact phrase behind one of the most common redirect-related searches, happens when a chain of rules eventually leads back to a page it already passed through, and the browser gives up rather than loop forever. It is an easy mistake to make by hand once a list grows past a handful of rules, especially after a second migration adds new redirects on top of old ones that were never cleaned up. Pro Mode's Duplicate & Loop Check walks every rule in a bulk list, follows each one to its final destination, and flags three distinct problems: an old path that appears more than once, two rules that send the same old path to different targets, and a chain that loops back on a page already in its own path. It also flags long redirect chains that resolve correctly but hop through more than one rule, worth tidying up even when they're not technically broken, since every extra hop adds a round trip for both visitors and crawlers.

Privacy Note

Every old path, new path, and bulk list this tool reads, along with every rule it builds, is processed entirely by JavaScript running in your own browser. Nothing is uploaded, logged, or transmitted to a server at any point, in Simple Mode or Pro Mode.

6Frequently Asked Questions

Is this .htaccess redirect generator really free, with no signup?
Yes. Enter an old path and a new path and click Generate Redirect Rule, free, with no account, no email address, and no software to install. The whole tool runs inside your browser tab using JavaScript, so there's nothing to download and no usage limit.
What's the real difference between a 301 and a 302 redirect?
A 301 redirect tells browsers and search engines a page has moved for good, so ranking signals transfer to the new URL and the old one drops out of the index over time. A 302 redirect signals a short-term move, so the original URL stays indexed and keeps its ranking, while visitors are still sent to the new page. Pick 301 for a permanent move and 302 for anything you expect to undo, like a maintenance page or an A/B test.
Does this tool generate Nginx redirects too, or only Apache .htaccess rules?
Simple Mode generates Apache .htaccess syntax, the Redirect directive most hosting guides show first. Pro Mode adds an Apache/Nginx toggle that rebuilds every rule, single, bulk, and wildcard, as Nginx location blocks with a return directive instead, so the same input works whether your site runs on Apache or Nginx.
Can I generate redirects for a whole list of old URLs at once?
Yes, in Pro Mode. Paste one old-path, new-path pair per line, separated by a comma, a tab, or an arrow, with an optional 301 or 302 per line, and the Bulk Redirect Generator builds the full block in one pass instead of one rule at a time.
What's a redirect loop, and how does this tool catch it?
A redirect loop happens when a chain of rules eventually points back to a page it already passed through, which is what causes the "too many redirects" error in a browser. Pro Mode's Duplicate & Loop Check walks every rule in your bulk list, follows each redirect to its final destination, and flags any chain that loops back on itself, along with duplicate old paths and rules that send the same old path to two different targets.

Built on the documented redirect standards. The 301/302 status-code behavior this tool explains, and the Apache and Nginx syntax it generates, match the HTTP redirection semantics documented in MDN's HTTP redirections guide, rather than an arbitrary or estimated interpretation.

More SEO & GEO Tools

Every other tool in the SEO & GEO Tools category

Meta Tag Generator Generates title, description & keyword meta tags, ready to paste
SERP Snippet Preview Shows exactly how your page will look in Google search results
Keyword Density Checker Scans your content and reports keyword frequency & prominence
XML Sitemap Generator Turns a list of URLs into a valid sitemap.xml file
Robots.txt Generator Builds a correct robots.txt with simple allow/disallow rules
Open Graph & Twitter Card Generator Creates social preview meta tags, with a live card preview
Schema / JSON-LD Markup Generator Builds FAQ, Article, HowTo, Product & Breadcrumb structured data
Meta Title & Description Length Checker Checks character & pixel-width so Google won't truncate it
Canonical Tag Generator Generates the correct <link rel="canonical"> tag for a URL
UTM Campaign URL Builder Builds trackable campaign links with source/medium/campaign params
Hreflang Tag Generator Builds hreflang tags for multi-language & multi-region pages
URL Slug Generator Turns any title into a clean, SEO-friendly URL slug
llms.txt Generator Builds an llms.txt file so AI models understand & prioritize your site
AI Crawler Access Generator Allow or block GPTBot, ClaudeBot, PerplexityBot & Google-Extended by name
FAQ / Q&A Schema Generator The same Schema/JSON-LD tool, FAQ markup is what AI engines quote most
AI Answer & Citation-Readiness Checker Scores your content on what AI engines look for when picking what to cite
Direct-Answer Box Formatter Reshapes a paragraph into the concise answer block AI engines tend to lift
Question-Heading Rewriter Turns keyword-style headings into natural questions people actually ask
Lilly
Here to help you find a tool
Search tools Search blogs
Try me to find a tool! 👋