La reescritura de Apache funciona en FreeBSD, no en CentOS

La reescritura de Apache funciona en FreeBSD, no en CentOS

Tengo 5 servidores de producción que ejecutan FreeBSD 9.2, pero estamos planeando hacer la transición a CentOS. Debido a esto, estoy intentando configurar algunas máquinas virtuales para emular nuestro entorno de servidor de producción usando CentOS 6.6. He configurado todo y funciona muy bien, guarde una única regla de reescritura.

<Directory /var/www/html/www/trunk/amapi>
  RewriteEngine on
  RewriteRule  ^$ public/    [L]
  RewriteRule  (.*) public/$1 [L]
</Directory>
<Directory /var/www/html/www/trunk/amapi/public>
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]
</Directory>
<Directory /var/www/html/www/trunk>
  RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*start\.php
  RewriteRule ^start.php/?(.*)$ $1 [R=301,L]

  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ start.php/$1?%{QUERY_STRING} [L]
</Directory>

Las dos primeras reglas de reescritura son para una API back-end que utiliza Phalcon y funcionan perfectamente en ambos entornos. La tercera regla de reescritura es un comodín para redirigir todas las solicitudes que no coinciden con un archivo real a start.php, que intenta hacerlas coincidir con un módulo Phalcon y luego a una página 404 si no coincide ninguna ruta.

Por alguna razón, funciona en FreeBSD que ejecuta Apache 2.2.27, pero no en CentOS que, por el momento, ejecuta Apache 2.2.15. Esta es una regla de reescritura muy simple que debería funcionar en cualquier versión de Apache sin problemas, pero Apache sigue arrojando un error 404 cuando intento acceder al archivo. ¿Me estoy perdiendo de algo? Obviamente, la configuración SSL y las opciones específicas faltan en el código mostrado, pero ese es el orden en que aparecen los requisitos en ssl.conf.

Gracias de antemano

Actualización: los registros de Apache Rewrite son:

10.1.1.135 - - [24/Feb/2015:17:39:17 --0500] [trunk.mydomain.com/sid#7f18f3072f98][rid#7f18f36099b8/initial] (2) init rewrite engine with requested uri /letters/custom/test
10.1.1.135 - - [24/Feb/2015:17:39:17 --0500] [trunk.mydomain.com/sid#7f18f3072f98][rid#7f18f36099b8/initial] (3) applying pattern '^/attc2/(.*)$' to uri '/letters/custom/test'
10.1.1.135 - - [24/Feb/2015:17:39:17 --0500] [trunk.mydomain.com/sid#7f18f3072f98][rid#7f18f36099b8/initial] (3) applying pattern '^/forms/(.*)$' to uri '/letters/custom/test'
10.1.1.135 - - [24/Feb/2015:17:39:17 --0500] [trunk.mydomain.com/sid#7f18f3072f98][rid#7f18f36099b8/initial] (3) applying pattern '^/grafx/(.*)$' to uri '/letters/custom/test'
10.1.1.135 - - [24/Feb/2015:17:39:17 --0500] [trunk.mydomain.com/sid#7f18f3072f98][rid#7f18f36099b8/initial] (3) applying pattern '^/xport/(.*)$' to uri '/letters/custom/test'
10.1.1.135 - - [24/Feb/2015:17:39:17 --0500] [trunk.mydomain.com/sid#7f18f3072f98][rid#7f18f36099b8/initial] (3) applying pattern '.*' to uri '/letters/custom/test'
10.1.1.135 - - [24/Feb/2015:17:39:17 --0500] [trunk.mydomain.com/sid#7f18f3072f98][rid#7f18f36099b8/initial] (4) RewriteCond: input='' pattern='!.*mydomain.com/.*$' [NC] => matched
10.1.1.135 - - [24/Feb/2015:17:39:17 --0500] [trunk.mydomain.com/sid#7f18f3072f98][rid#7f18f36099b8/initial] (4) RewriteCond: input='/letters/custom/test' pattern='\\.(jpg|gif|png)$' => not-matched
10.1.1.135 - - [24/Feb/2015:17:39:17 --0500] [trunk.mydomain.com/sid#7f18f3072f98][rid#7f18f36099b8/initial] (1) pass through /letters/custom/test

Respuesta1

Me pregunto si posiblemente el problema sea solo un punto sin escape. Intente reemplazar esta línea:

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*start\.php

Con:

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /\.*start\.php

información relacionada