I am using Virtual Box VM and Vagrant to create an Ubuntu 14 box and have no choice but to use apache 2.4.23 as a web server. My app has a front controller (index.php) that is handles most of the work of the site in terms of routing, but there are some standard files that users can access as well.
There are other devs on my team that still have apache 2.4.20 and their boxes are working exactly as expected.
My problem is that the rewrite rules aren't acting as expected. Here is the .htaccess file before upgrading to 2.4.23:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php/$1
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) /index.php/$1 [L]
Options All -Indexes
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
Here is the apache2.conf:
# Security
ServerTokens OS
ServerSignature On
TraceEnable On
ServerName "my-local"
ServerRoot "/etc/apache2"
PidFile ${APACHE_PID_FILE}
Timeout 120
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15
User www-data
Group www-data
AccessFileName .htaccess
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
<Directory /var/www/>
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
HostnameLookups Off
ErrorLog "/var/log/apache2/error.log"
LogLevel warn
EnableSendfile Off
#Listen 80
Include "/etc/apache2/mods-enabled/*.load"
Include "/etc/apache2/mods-enabled/*.conf"
Include "/etc/apache2/ports.conf"
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combi$
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
IncludeOptional "/etc/apache2/conf.d/*.conf"
IncludeOptional "/etc/apache2/sites-enabled/*"
I can access the site as long as I add R
to the Rewrite rule, but that is clearing out POST. I tried using GET as a quick workaround, but some of my forms end up with request strings that are too long for apache.
I need to know if there is a flaw in these configs that I am unable to see or if there is a workaround that I am unaware of.