httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Javier Martínez Fernández <>
Subject [users@httpd] RewriteRule
Date Wed, 31 Jan 2007 19:44:40 GMT
I'm making a rewrite rule and I'm having problems with the "?" character
My rule is this
RewriteRule ^([a-z0-9-]+)/?([a-z0-9-]+)?/?([0-9]+)?\?([a-z0-9=]+)?$  
index.php?controller=$1&action=$2&id=$3&$4 [NC,L]
and the url I test is "http://localhost:8888/kmodo/something/more/1? 

It doesn't work, but I change the rule to
RewriteRule ^([a-z0-9-]+)/?([a-z0-9-]+)?/?([0-9]+)?\\([a-z0-9=]+)?$  
index.php?controller=$1&action=$2&id=$3&$4 [NC,L]
and test the url with "http://localhost:8888/kmodo/something/more/1 

The rewrite is working (see the difference  between \\ with \?).

Someone can say me what I'm doing wrong?

PD: regular expressions are my weak point :)

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