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 18:39:06 GMT
On Sat, 14 Aug 2004 20:36:39 +0300, Cristian Bichis
<cristian.bichis@gmx.net> wrote:
> Thank you...
> 
> I solved a part of the problem... For http://host/param/ all is ok....
> 
> But still I cannot catch the parameter for a URL as http://host/param
> 
> For the rule:
> 
>         RewriteRule ^([^/]*)$ rule.php?page=$1

Try using ^([^/]*)/?$ instead of the current pattern.  (That just adds
/? before the dollar sign.)  Make similar changes to the other two
patterns.

So, you should now have these three rewrite rules:

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

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