Zero Signup ToolsFree browser tools

SEO Tools

.htaccess Redirect Tester

Test an Apache .htaccess against any URL. See the matched rule, final destination, status code, full redirect chain, loops, and shadowed rules.

.htaccess file

Paste the relevant block from your Apache .htaccess. RewriteEngine, RewriteCond, RewriteRule, Redirect, and RedirectMatch are evaluated.

2 rules parsed

URLs to test

One path or absolute URL per line. The host part is ignored; matching is done on the path. Up to 50 lines.

Request context

Used by RewriteCond to evaluate %{HTTP_HOST}, %{HTTPS}, and %{REQUEST_METHOD}. File-test conditions like -f and -d cannot run in a browser; the WordPress sample shows how those fall through.

Results (4)

Each card shows the verdict, every hop, the rule that fired, and the line number to find it in your file.

4 redirects
  • /about

    Redirect 301

    Redirect 301 to /about.

    1. hop 1301line 5

      /about

      RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1

    Final URL

    /about

  • /blog/launch

    Redirect 301

    Redirect 301 to /blog/launch.

    1. hop 1301line 5

      /blog/launch

      RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1

    Final URL

    /blog/launch

  • http://example.com/contact

    Redirect 301

    Redirect 301 to /contact.

    1. hop 1301line 5

      /contact

      RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1

    Final URL

    /contact

  • https://www.example.com/pricing

    Redirect 301

    Redirect 301 to /pricing.

    1. hop 1301line 5

      /pricing

      RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1

    Final URL

    /pricing

Supported directives

  • RewriteEngine on or off
  • RewriteBase /prefix
  • RewriteCond %{VAR} pattern [NC,OR]
  • RewriteRule pattern substitution [R=NNN,L,F,G,NC,QSA,QSD,END]
  • Redirect [code] /from /to (mod_alias)
  • RedirectMatch [code] regex destination
  • Server variables: REQUEST_URI, REQUEST_METHOD, HTTP_HOST, HTTPS, QUERY_STRING.

How to use

  1. Paste the redirect-relevant block from your .htaccess into the rules input on the left, or click a sample (Force HTTPS, WordPress, Trailing slash, Blog rename, SPA fallback, or Redirect loop).
  2. Paste the candidate URLs to test (one path per line, like /old/post or /summer-sale) into the URLs input below. Absolute URLs work too; the host part is ignored and matching is done on the path.
  3. If your rules read %{HTTP_HOST}, %{HTTPS}, or %{REQUEST_METHOD}, set them in the Request context card. The HTTPS toggle drives RewriteCond %{HTTPS} on or off.
  4. Read each result card on the right: the verdict badge (Redirect 301, Rewrite 200, No match, Forbidden 403, Gone 410, Loop, or Too many hops), the full hop list with line numbers, and the final URL.
  5. Use Copy report to grab a plain-text trace for a pull request, migration ticket, or hosting-support thread. Fix any rule the parser flags as an error or warning, then re-run.

About this tool

.htaccess Redirect Tester emulates Apache's mod_rewrite and mod_alias engines in your browser. Paste the redirect block from your .htaccess (RewriteEngine, RewriteBase, RewriteCond, RewriteRule, Redirect, RedirectMatch), then paste one or more candidate URLs. For each URL the tester walks the rules in order, applies the first match, and reports what would actually happen on a live Apache server: the matched rule and its source line number, the destination after $N rule backreference and %1..%9 RewriteCond capture substitution, the effective status code (301, 302, 303, 307, 308 for browser redirects; 200 for in-place internal rewrites; 403 for [F] forbidden; 410 for [G] or 410 gone), and the full hop trace when one rewrite or redirect points at a URL that another rule rewrites again. A loop detector trips when a hop returns to a URL the chain has already visited, so you can see exactly which rule closes the cycle before you ship a broken site. A shadow detector flags later rules whose pattern is already swallowed by an earlier unconditional [L] or [R] rule and that therefore never fire. The parser understands the directive subset that real shared-hosting .htaccess files actually use: comments starting with #, IfModule wrappers, RewriteEngine on or off, RewriteBase, RewriteCond with %{REQUEST_URI}, %{REQUEST_METHOD}, %{HTTP_HOST}, %{HTTPS}, and %{QUERY_STRING}, the [NC] and [OR] condition flags, RewriteRule with [R=NNN], [L], [F], [G], [NC], [QSA], [QSD], and [END] flags, Redirect with status keywords permanent, temp, seeother, gone, and RedirectMatch with regex destinations. Optional request-context fields (HTTP host, HTTPS, request method) let you evaluate conditional rules without spinning up Apache locally: leave them at the defaults to model an http://example.com GET request, or change them to see how an HTTPS POST from a different host would route. The grammar checks also catch the small mistakes that survive into production: invalid regex patterns, missing destinations, source paths that should start with a leading slash, RewriteCond above a mod_alias Redirect (mod_alias does not honor RewriteCond), and RewriteCond at end of file with no following RewriteRule. Everything runs locally on your device; the .htaccess block, the candidate URLs, and the request context never leave the browser tab.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsSEO Tools