Esta página aún no está traducida al español, así que la mostramos en inglés.

.htaccess Tester & Validator

Find the line that causes a 500 error and test rewrite rules before you deploy: enter a URL to see which conditions match, where it redirects or what it rewrites to.

Actualizado el

Test a URL

Validation

Tus datos nunca salen de tu ordenador. Todo se procesa localmente en tu navegador.

Cómo usar: .htaccess Tester & Validator

  1. Paste your .htaccess file (or click Test rules in the .htaccess generator).
  2. Check the validation panel for errors that would cause a 500 error, and warnings for rules that never match.
  3. Enter a request URL to simulate it: each condition and rule is evaluated and the final redirect or rewrite is shown.
  4. List existing files and directories to test -f and -d conditions.

What the validator checks

  • Unknown directives and typos — Apache answers any unknown directive in .htaccess with a 500 Internal Server Error.
  • Server-only directives such as ServerName, <VirtualHost> or <Directory>, which are not allowed in .htaccess.
  • Unbalanced containers — an <IfModule> or <FilesMatch> that is never closed.
  • Invalid regular expressions and unknown RewriteRule / RewriteCond flags.
  • Logic problems: patterns starting with ^/ (they never match in .htaccess), redirects without L, conditions with no rule, rules before RewriteEngine On.
  • Compatibility: Apache 2.2 Order/Allow/Deny, php_value on PHP-FPM hosts, mixed Options syntax.

How the rewrite simulation works

Like Apache, the tester strips the leading slash from the path, evaluates each RewriteRule in order, checks its RewriteCond lines (with [OR] and [NC]), substitutes $1 and %1 back-references and server variables such as %{HTTP_HOST}, %{HTTPS}, %{REQUEST_URI} and %{QUERY_STRING}, and applies flags like R=301, L, QSA, F and G. After an internal rewrite it runs the rules again, just as Apache does in per-directory context. Redirect and RedirectMatch are tested too.

Limits

The simulator uses JavaScript regular expressions, which match PCRE for almost all .htaccess patterns. It cannot know your server’s file system (list files for -f/-d tests), RewriteMap, environment set by other modules, or the order in which mod_alias and mod_rewrite run on your server. Always confirm with a real request — the redirect checker shows the live redirect chain.

Build a new file with the .htaccess generator, and test the regular expressions in detail with the regex tester.

También se busca como: htaccess tester, htaccess validator, test rewrite rules, htaccess checker, mod_rewrite tester, htaccess syntax check, rewriterule tester.

Herramientas que combinan con: .htaccess Tester & Validator

  • Htpasswd Generator — Generate user:hash lines for HTTP Basic Authentication in Apache, Nginx, Traefik and Caddy — with bcrypt by default and nothing sent to a server.
  • HTTP Status Codes — Every standard HTTP response code explained in plain English, with when to use it and how it affects SEO.
  • YAML Validator — Paste a Docker Compose file, Kubernetes manifest, GitHub Actions workflow or any YAML to pinpoint errors, catch common pitfalls and get a cleanly formatted version.
  • Kubernetes YAML Generator — Fill in your app’s name, image and port and get production-ready Kubernetes YAML: a Deployment with probes, resource limits and a hardened security context, plus the Service, Ingress with TLS, ConfigMap, Secret and HorizontalPodAutoscaler you tick — in one file ready for kubectl apply.

Preguntas frecuentes

How do I find the line causing a 500 error?
Paste the file here: unknown directives, server-only directives, unclosed tags and invalid regular expressions are listed with their line numbers. On the server, Apache’s error log names the line too.
Why does my RewriteRule ^/page$ never match?
In .htaccess the path is matched without the leading slash. Use ^page$ instead of ^/page$.
Is the simulation exactly like Apache?
It follows Apache’s per-directory rewrite logic for the common directives and flags, but cannot see your file system or other modules. Treat it as a fast check and confirm with a live request.
Is my .htaccess uploaded?
No. Validation and simulation run in your browser.
¿Puedo instalar .htaccess Tester & Validator como aplicación web y utilizarla sin conexión?
Sí. .htaccess Tester & Validator es una aplicación web instalable (PWA): se instala desde el navegador, no se descarga desde una tienda de aplicaciones. Haz clic en «Instalar aplicación» en la parte superior de esta página en Chrome o Edge (Windows, macOS, Linux, ChromeOS) o, en Android, utiliza «Compartir» → «Añadir a la pantalla de inicio» en iPhone y iPad, o «Archivo» → «Añadir al Dock» en Safari 17+ en un Mac. A continuación, se abrirá en su propia ventana con su propio icono y, como se ejecuta íntegramente en tu navegador, seguirá funcionando sin conexión. Firefox en el ordenador de sobremesa no permite instalar aplicaciones web. Cómo funciona la instalación.

Herramientas relacionadas