I have a virtual host and have enabled AllowOverride All
. I know this works since the rewrite rules within the /var/www/site/web/.htaccess
are being executed (It's a Symfony app). However when I have a DEFLATE
rule in there it doesn't work. For example simply:
AddOutputFilterByType DEFLATE application/json
However if I put this into my virtual host configuration it works. This looks like:
/etc/apache2/sites-enabled/site.dev.conf
<VirtualHost *:80>
ServerName site.dev
DocumentRoot /var/www/site/web
<Directory /var/www/site/web>
AllowOverride All
Require all granted
</Directory>
# Setup passthrough to phm-fpm and auth header fix
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/site/web/$1
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
ErrorLog /var/log/apache2/site_error.log
CustomLog /var/log/apache2/site_access.log combined
</VirtualHost>
Any suggestions as to why this isn't working? I know that it's best to have such rules applied within the virtual host or better still the main apache config. But I am just curious as to why it's not working when placed within the .htaccess
This is running Apache 2.4