I am trying to set specific server side value for virtual paths used to upload files.
All my URLs are virtual and requested are dispatched by a front controller. I have the following config in my site's only .htaccess
file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^ index.php [L]
</IfModule>
Since upload_max_filesize
cannot be set with ini_set
, I need to used either .htaccess
files or Apache .conf
to overrides this setting.
Considering I do not have real files/folders to put .htaccess
, I presume the only way is to use Apache .conf
.
I tried several ways to make it way using either <LocationMatch>
, <Location>
and even <FilesMatch>
but cannot figure out how to make it work.
Here is how my site's vhost.conf
look like:
<LocationMatch "upload">
php_value upload_max_filesize 60M
</LocationMatch>
<Directory "/mysite/documentroot">
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
My theory is that since my site is using a single FrontController that that the <Location>
rule is applied after the redirect, it's impossible to do this from an Apache side.
Unless I missed something, the best way to solve this would be to request a feature change on the PHP side to allow changing these settings using ini_set
?