← All tools

.htaccess Redirect and Rewrite Tester

Simulate supported Apache document-root rules for a supplied URL and inspect the evaluated lines, conditions and destination in a local Worker.

htaccess-testerLOCAL WORKSPACE

Enabling local controls…

Rules and test request

Supported directives and limits

Use a document-root snippet, up to 32 KiB and 500 lines. A path-only input assumes http://example.test. Paths use ASCII unreserved characters and single slashes. The browser simulates one pass; it does not start Apache, resolve files or follow redirects.

  • RewriteEngine On or Off (default Off); The first RewriteRule compares the path without its leading slash. After an internal substitution, the next rule sees the path with or without its leading slash according to that substitution; REQUEST_URI stays at the original path. Supported flags: L, END, NC, QSA, QSD and R (301, 302, 303, 307, 308). Use L or END when an external redirect has later rules.
  • RewriteCond supports HTTPS, HTTP_HOST, REQUEST_SCHEME, REQUEST_URI and QUERY_STRING with regex or equality. Use ! to negate and NC or OR when needed. REQUEST_FILENAME supports -f and -d only, assuming no files or directories exist.
  • HTTP_HOST compares the supplied ASCII authority as written, including letter case and an explicit port. When a rule in the chain sets a query that will be redirected, use letters, digits and . _ ~ & = + - in the combined query. For percent escapes, verify the Location header in Apache.
  • Regex uses ECMAScript syntax (256 characters per pattern) and runs in a cancellable Worker with a one-second processing limit. Redirect (mod_alias) supports simple path prefixes and destinations without a query or fragment. Test it in a separate snippet from RewriteRule.

Apache mod_rewrite · RewriteRule flags · mod_alias Redirect

Simulation report

Enter rules and simulate a request.

How to use this tool

Paste a mod_rewrite or mod_alias snippet, enter a URL or path and simulate. Review the rule trace and copy or download the complete report.

When not to use it

The simulation covers one pass of a documented subset; no Apache process, configuration inheritance, real files, proxying or live requests. Verify exact behavior on your target deployment.

Read the guide →