httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Ionescu <>
Subject Re: [users@httpd] Mod_rewrite and default document
Date Mon, 11 Sep 2006 23:42:53 GMT
Erik Funkenbusch wrote:
>> # 1 rewrite /?id=123 as index.php?id=123 - Does not work

It is intended *not* to match in this case - and if you are using 
numerical values, why are you using the regEx .* which matches too much, 
your second rule will never work, because the first one will match once 
the filepath contains 1 or n chars.

RewriteEngine on
RewriteRule ^([0-9]+)$ /index.php?id=$1 [L]
# 2 rewrite /123/blah as index.php?id=123&blah
RewriteRule ^([0-9]+)/(.+)$ /index.php?id=$1&$2 [L]

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