1

I have a URL as follows www.example.com/fr_FR the curl return type is as follows:

HTTP/1.1 200 OK
Date: Mon, 16 Oct 2017 10:35:19 GMT
Server: Apache
Set-Cookie: PHPSESSID=img4385scm6ldm6vngtntsrou1; path=/; HttpOnly
Cache-Control: no-cache
Set-Cookie: FirstVisit=1; expires=Wed, 18-Oct-2017 10:35:20 GMT; Max-Age=172800; path=/; httponly
Cache-Control: no-cache
Content-Type: text/html; charset=UTF-8

My .htaccess contains the following directive:

<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript application/javascript application/rss+xml application/xml application/xhtml+xml application/x-font-ttf application/x-font-opentype image/svg+xml
</IfModule>

The issue is that the particular URL is not being gzipped, however, if I access a .html file or if I do add the AddOutputFilterByType DEFLATE text/html directly in my apache vhost the gzip works:

Content-Encoding: gzip

For information in my vhost AllowOverride is set to All.

What is wrong with the URL /fr_FR, why is it not being gziped even though the Content-Type is text/html?

Update1:

For information my site is a symfony2 site

  • Try removing the `` wrapper around that directive. "`AllowOverride` is set to `All`" - in the appropriate `` container? – MrWhite Oct 16 '17 at 11:16
  • 1
    @MrWhite Hello, I did remove the `` wrapper but the issue is the same. Yes `AllowOveride` is set to `All` in the concerned `` block – Kheshav Sewnundun Oct 16 '17 at 11:27
  • Try to enable enable GZIP compression as described at https://www.rosehosting.com/blog/set-up-wordpress-with-optimal-htaccess-settings/ – RoseHosting Oct 16 '17 at 12:00
  • 1
    @RoseHosting That link doesn't offer anything that isn't already mentioned in the question? (It also looks very self-promoting.) – MrWhite Oct 16 '17 at 17:42

1 Answers1

0

apache docs(http://httpd.apache.org/docs/2.2/mod/core.html#addoutputfilterbytype) suggest that AddOutputFilterByType may fail partially or completely in some cases. Also this directive is deprecated in apache 2.1 and later. Since you said .html works can you try:

AddType text/html .html
Mr Kashyap
  • 116
  • 4