httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Joseph Olaes <thomas.ol...@gmail.com>
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:

<?php
  echo $t;
  echo "<pre>";
  print_r($_SERVER);
  echo "</pre>";
?>

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

The .htaccess is currently sitting at http://www.mydomain.com/test/cb,
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.

-TJ

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message