Generate single or bulk Apache redirects, or paste and test an existing .htaccess configuration. Detect malformed rules, chains, and loops, then copy a ready-to-use file free in your browser—no signup or upload.
Redirects
Start with the old URL and destination. Output updates live.
Redirect presets
Add an editable, loop-guarded recipe. Replace example hosts and paths before deployment.
Bulk paste or CSV/TSV import
Columns: old URL, destination, optional status. Headers are optional; quoted CSV is supported.
Advanced settings
Resolves path-only tests and checks same-site chains.
Redirect/RedirectMatch use URL-path matching and run before per-directory RewriteRule processing. Conditions, query controls, case matching, and fragment handling require mod_rewrite; mixing both styles can make ordering surprising.
Private by design: generation, imports, and testing run locally. No request is sent to your website.
Paste an existing .htaccess configuration
Supported: RewriteEngine, RewriteCond for HTTP_HOST, HTTPS, QUERY_STRING, or REQUEST_URI, RewriteRule, Redirect, and RedirectMatch. Unsupported syntax is reported by line and never approximated.
Simulation boundary: Apache uses PCRE and server state. Filesystem checks, maps, variables outside the supported list, internal rewrites, encoded-path edge cases, and directives in other configuration files require testing on the actual server.
Redirect test matrix
Tests the valid generated rules above. One request per line; optional expected status and destination may be separated by tabs, commas, or |.
Stops chains and detects loops.
Common redirect examples
Each worked example is visible without JavaScript. “Load into generator” makes an editable copy.
Single page
Move exactly one page.
RedirectMatch 301 "^/old-page$" "/new-page"
/old-page → /new-page
Directory wildcard
Retain the remainder of every path below a folder.
[NC] makes a rewrite match case-insensitively. These rules target Apache 2.4 and generally LiteSpeed; Nginx does not read .htaccess.
RewriteRule ^old$ /new [R=301,L,NC]
/OLD → /new
Choose the right redirect status
Status
Meaning
Method behavior
Typical use
301 Moved Permanently
Permanent move
Older clients may change a non-GET request to GET
Stable page or site migrations after testing
302 Found
Temporary redirect
Older clients may change a non-GET request to GET
Short-lived routing and pre-production testing
303 See Other
Fetch another resource
Follow-up request uses GET (or HEAD)
Post/Redirect/Get workflows
307 Temporary Redirect
Temporary redirect
Preserves the request method and body
Temporary API or form endpoint moves
308 Permanent Redirect
Permanent move
Preserves the request method and body
Permanent API or method-sensitive moves
How to generate and deploy redirect rules
Add rules in priority order. Put specific paths above broader prefixes. Use advanced regex only when exact or prefix matching cannot express the redirect.
Choose a temporary or permanent status. A 302 or 307 is easier to change while testing; switch to 301 or 308 only when the destination is stable.
Review query-string behavior. Apache normally preserves an incoming query when the destination has none. Use QSA to append it to a destination query or QSD to discard it.
Test representative URLs. Include exact paths, descendants, near misses, query strings, mixed case, and destinations that might be caught again.
Back up and deploy. Merge the output near the top of the root .htaccess, before CMS or front-controller rules. Do not overwrite unrelated security, caching, or routing directives.
Verify the real response. Use browser developer tools or curl -I to confirm the status and Location. Check several redirects and watch for loops or unexpected chains.
Deployment limit: a syntax error can cause an HTTP 500 response. Your host must allow FileInfo overrides and enable mod_rewrite. Keep a recoverable backup and use your hosting provider’s staging or validation tools when available.
Scope, references, and verification
Root .htaccess context
The generated RewriteRule patterns omit the leading slash because Apache strips it in per-directory context.
Ordered trace
The simulator evaluates conditions and redirects from top to bottom, reports skipped rules, and follows the first redirect through a configurable number of hops.
Query strings are separate
The rule pattern matches the URL path, not its query string. Query behavior is controlled with the substitution and QSA or QSD.
Regex simulation has limits
Apache 2.4 uses PCRE, while this browser uses JavaScript regular expressions. Basic anchors, groups, classes, and common quantifiers align; engine-specific features may not.
Last verified: 31 August 2026 · Target: Apache HTTP Server 2.4, root .htaccess (per-directory) context · Publisher and technical review: Starlight Robotics engineering.
Testing method: maintained simulation fixtures cover exact, prefix, regular-expression, host, scheme, query, duplicate, conflict, chain, and loop cases. The simulator does not claim byte-for-byte parity with Apache PCRE or a live server.
What is the difference between a 301 and 302 redirect?
A 301 says the move is permanent, while a 302 says it is temporary. Browsers and search engines may cache permanent redirects more aggressively, so test with a temporary status before making a migration permanent.
Should I use 307 or 308 for form URLs?
307 and 308 explicitly preserve the request method and body: 307 is temporary and 308 is permanent. Redirecting POST or other non-GET requests still requires application-specific testing.
Why does a RewriteRule pattern omit the leading slash?
In per-directory .htaccess context, Apache removes the directory prefix, including the leading slash, before matching a RewriteRule pattern. This generator targets a root .htaccess file.
Are incoming query strings preserved?
By default, Apache carries the incoming query string forward when the substitution has no query string. A query in the substitution replaces it. QSA appends the incoming query, and QSD discards it.
Does the browser tester exactly reproduce Apache?
No. It models generated rules and the explicitly supported pasted directives in common root .htaccess behavior, but JavaScript and Apache PCRE regular expressions differ. Modules, server configuration, filesystem mapping, encoded paths, and rules elsewhere can change the real result.
Where should these rules go?
They are designed for the site root .htaccess and generally belong before front-controller rules. The server must allow FileInfo overrides and have mod_rewrite enabled.
Can redirects create a loop?
Yes. A destination that is also matched by the same or a later redirect can loop or chain. This tool flags obvious self-redirects, but you should test every representative URL on the deployed server.