[CentOS] CentOS 6.8 Apache-2.2.15-53 re-write question

Sat May 28 20:26:35 UTC 2016
Alexander Dalloz <ad+lists at uni-x.org>

Am 28.05.2016 um 22:08 schrieb Paul R. Ganci:
> On 05/28/2016 01:35 PM, Alexander Dalloz wrote:
>> Am 28.05.2016 um 21:03 schrieb Paul R. Ganci:
>>> Starting httpd: Syntax error on line 31 of
>>> /etc/httpd/conf.d/olddomain.conf:
>>> RewriteCond: bad argument line '%{REQUEST_URI}!^/test/
>> You missed a whitespace between the server variable %{REUQEST_URI} and
>> the value you test against. In both cases you did. And you probly want
>> a trailing [OR] parameter. See
>> https://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritecond
> I did the suggested changes and indeed the syntax error goes away but
> the code does not work. The redirection takes place for all the pages
> even for those specified in the RewriteCond lines. My immediate syntax
> error problem is solved. It is funny how I stared at these lines for
> what seemed like eons and my mind fixed the immediate problem.
> Thanks for your help,  Alexander.  I will take another look at what I
> did and see if I can't find what else is wrong.

May I suggest you enable special logging for the mod_rewrite activity?


(Btw. that has changed with Apache 2.4)

With a dedicated logging of what happens for rewrites you should be able 
to detect what is different to your intention.