httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brent 'Dax' Royal-Gordon <brent...@gmail.com>
Subject Re: [users@httpd] mod_rewrite for one parameter
Date Sat, 14 Aug 2004 16:19:45 GMT
On Sat, 14 Aug 2004 13:48:05 +0300, Cristian Bichis
<cristian.bichis@gmx.net> wrote:

>         #RewriteRule ^(.*)$ rule.php?page=$1
>         RewriteRule ^(.*)/(.*)$ rule.php?lang=$1&page=$2
>         RewriteRule ^(.*)/(.*)/(.*)$ rule.php?lang=$1&page=$2&subpage=$3

The problem is that "." matches any character, *including* slash. 
Replace all the dots (except for the one in "rule.php", of course)
with "[^/]" and you should have much more success.  Alternately,
reversing the order of the rules (so the rules with more slashes have
a chance to match first) could help, but that's prone to error.


-- 
Brent 'Dax' Royal-Gordon <brent@brentdax.com>
Perl and Parrot hacker

There is no cabal.

---------------------------------------------------------------------
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