Re: Re: Ampersand extends to the left part of regexes with RewriteRule, RedirectMatch and SetEnvIf: is that expected?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Francis GALIEGUE wrote:
On Fri, Dec 4, 2009 at 09:55, Francis GALIEGUE <fge@xxxxxxxxxxxx> wrote:
Hello everyone,

I've had the request to redirect a particular URI, say /foo or /foo/
to http://some.external.site/?var1=val1&var2=val2&var3=val3. The
Apache server version is 2.0.52 used on RHEL 4.x. I have tested with
2.2.3 on RHEL 5.x and the behaviour below is the same...


This has also been tested on the latest Debian stable: the behavior is
exactly the same. It seems that it is the core Apache regex mechanism
which is in cause here.

Now, the question is, is it intended.

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.


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


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux