I have 5 production servers which are running FreeBSD 9.2, but we are planning on transitioning to CentOS. Because of this, I am attempting to set up some virtual machines to emulate our production server environment using CentOS 6.6. I have set everything up and it works great, save a single rewrite rule.
<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>
The first two rewrite rules are for a back end API using Phalcon, and they work perfectly in both environments. The third rewrite rule is a catch all to redirect all requests that don't match a real file to start.php which attempts to match them to a Phalcon module and then on to a 404 page if no route gets matched.
For some reason, it works under FreeBSD which is running Apache 2.2.27, but not under CentOS which is, for the moment, running Apache 2.2.15. This is a very simple rewrite rule which should work under either version of Apache with no problems, but apache keeps throwing a 404 when I attempt to access the file. Am I missing something? Obviously the SSL config and specific options are missing from the code displayed, but those are the order in which the reqrites appear in ssl.conf.
Thanks in Advance
Update: Apache Rewrite logs are:
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