On Fri, Jun 26, 2015 at 10:15 PM, James Moe <ji...@sohnen-moe.com> wrote:

>   The rewrite is in <.htaccess>. Other rewrites work as expected.
>

Okay then I feel quite confident in concluding the query string is not in
the form you expect. So I'll reinforce my earlier point that it is never a
good idea to perform a match on more than a single parameter at a time in a
query string using mod_rewrite. In the future, perhaps as part of this
migration, you or a coworker might make a change that alters the appearance
of that query string. Even an innocuous change that you don't believe will
alter the query string might have the unexpected side-effect of doing so.
And then your literal query string match will fail.


> That was one of the many variants I have tried. It does not work
> either. Since I cannot get logging to work either (grr), I cannot see
> what is happening.


Rather than trying to set LogLevel to include more verbose logging of the
rewrite module actions I would change the LogFormat to include the query
string. For example, this is the one I use:


LogFormat "%{%Y-%m-%dT%H:%M:%S}t %{sec}t.%{usec_frac}t %>s %{error-notes}e
%D %B %h %{Host}i \"%r\" \"%{User-Agent}i\"" krader_custom
CustomLog "/private/var/log/apache2/access.log" krader_custom


Notice the "%r". That logs the entire first line of the request.  Here is
the log entry from the experiment I did to see if your rewrite rule works:

2015-06-26T18:01:39 1435366899.344840 200 - 228749 61272 ::1 localhost "GET
/?app=ecom&ns=catshow&ref=books HTTP/1.1" "curl/7.37.1"

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

Reply via email to