On Fri, Dec 4, 2009 at 14:07, André Warnier <aw@xxxxxxxxxx> wrote: [...] > First, I believe that one mistake is to include the trailing question mark > into the URL which you redirect. > In http://my.server.com/foo/?var1=val1... > The "?" is not actually part of the URI. It is a separator between the URI > and the query string. So the URI to test is "/foo/", and not "/foo/?". > Second, in "RedirectMatch", "RewriteCond" and "RewriteRule", the argument is > a regexp, not a string. So when you write "/foo/?$", you mean actually : > "/foo", possibly followed by "/", followed by the end of the string. > If you really wanted to test for a "?", you would have to escape it as "\?". > > I do not know if this is the source of your particular problem, but it may > contribute to the strange results which you are seeing later. > No, the ? is intended, I want to match either /foo or /foo/, so ^/foo/?$ is the correct regex, I'm sure about that. The problem I have is with the & being systematically understood by the right size of regexes to mean "the whole thing matched by the matching left regex". While this is a common regex idiom in "basic" regexes (sed acts this way for instance), it is not expected at all from pcre (Perl doesn't know about &, and from what I've read about pcre so far, pcre doesn't know about it either). Hence my puzzle. -- Francis Galiegue ONE2TEAM Ingénieur système Mob : +33 (0) 683 877 875 Tel : +33 (0) 178 945 552 fge@xxxxxxxxxxxx 40 avenue Raymond Poincaré 75116 Paris --------------------------------------------------------------------- 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@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx