Paul R. Ganci
2016-May-28 20:08 UTC
[CentOS] CentOS 6.8 Apache-2.2.15-53 re-write question
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#rewritecondI 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. -- Paul (ganci at nurdog.com) Cell: (303)257-5208
Alexander Dalloz
2016-May-28 20:26 UTC
[CentOS] CentOS 6.8 Apache-2.2.15-53 re-write question
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? https://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritelog https://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriteloglevel (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. Alexander
Paul R. Ganci
2016-May-28 20:37 UTC
[CentOS] CentOS 6.8 Apache-2.2.15-53 re-write question
On 05/28/2016 02:26 PM, Alexander Dalloz wrote:> May I suggest you enable special logging for the mod_rewrite activity? > > https://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritelog > https://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriteloglevel >Yes this is a good idea. -- Paul (ganci at nurdog.com) Cell: (303)257-5208