httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Joseph Olaes <>
Subject [users@httpd] mod_rewrite backreference not giving me what I want
Date Tue, 24 Aug 2004 17:57:58 GMT
Hello list,

I'm having a bit of a problem. I'm trying to use .htaccess to
implement some mod_rewrite rules. Here's what I have:

RewriteEngine on
RewriteBase /test/cb
RewriteRule ^test\.htm$ index.php?t=a$0 [L]
RewriteRule ^(.*)\.(php|html?)$ index.php?t=b$0 [L]

in index.php, I have:

  echo $t;
  echo "<pre>";
  echo "</pre>";

for pretty much every URL I send to this directory, I always get the
second RewriteRule.

The .htaccess is currently sitting at,
as is the index.php file.

My question is: why is the $0 backreference matching the page that the
path gets rewritten to, instead of the matched regexp string from the
path submitted to the server?

Thanks in advance for any answers and time given to my question.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message