Paste your .htaccess and a URL. You get every RewriteCond
with the value it was actually tested against, every RewriteRule that matched or
didn’t, and what Apache would finally do with the request.
This runs entirely in your browser. Your .htaccess is not
uploaded, not logged, and not sent anywhere — there is no server behind this page, only a
static file and the simulator compiled to JavaScript. No account, no email address, no limit on
how many times you use it.
Four causes account for most of it, and the trace above names which one you have:
[L]. Processing of
that pass stopped there. The trace shows the rule that won.RewriteCond failed. Conditions are tested against an expanded
string, not the one you wrote; the trace prints the expanded value next to the pattern..htaccess, Apache strips the directory prefix before matching, so ^/blog
never matches anything.RewriteCond %{REQUEST_FILENAME} !-f
cannot be answered without your filesystem, so the simulator assumes the file does not exist and
says so on the line. That is the common case for a front controller and the wrong case if you are
debugging a rule that depends on a file existing.RewriteBase, RewriteMap,
proxying and server-config context are not modelled.This page is the parser, simulator and validator from .htaccess Pro, a JetBrains IDE plugin, compiled to JavaScript. Same code, no second implementation. In the IDE it runs against the file open in your editor, and double-clicking a line of the trace jumps to that line of the file.
The plugin is free while in early access. Add
https://theseusbuilds.pages.dev/htaccess-pro/updatePlugins.xml under Settings → Plugins → gear → Manage Plugin
Repositories, then install “.htaccess Pro”. Current version 1.0.3.
The engine is also open source under the MIT licence, as a command-line tool:
github.com/theseusbuilds/htaccess-trace
— npx github:theseusbuilds/htaccess-trace .htaccess /blog/hello-world.
Found a file this gets wrong? That is the most useful thing you can send me: hello@theseusbuilds.dev.