Hi,
I want to serve gzip static html files, but the default seems to ignore them (i get a directory access forbidden), so I tried .htaccess rules:
I get the same Forbidden message when using a URL pointing to a directory (i.e looking for an index.html, but only index.html.gz is there); if i specify the file, index.html - then the file is downloaded by the browser.
The code above works on another linux server i use, and I am baffled at the moment. Any suggestions regarding the DirectAdmin set up wrt to gzip file handling, would be received with delight. I am not intending to have dynamic compression; these are static files.
I want to serve gzip static html files, but the default seems to ignore them (i get a directory access forbidden), so I tried .htaccess rules:
Code:
#Check to see if browser can accept gzip files.
ReWriteCond %{HTTP:accept-encoding} (gzip)
#make sure there's no trailing .gz on the url
ReWriteCond %{REQUEST_FILENAME} !^.+\.gz$
#check to see if a .gz version of the file exists.
RewriteCond %{REQUEST_FILENAME}.gz -f
#All conditions met so add .gz to URL filename (invisibly)
RewriteRule ^(.+) $1.gz [L]
I get the same Forbidden message when using a URL pointing to a directory (i.e looking for an index.html, but only index.html.gz is there); if i specify the file, index.html - then the file is downloaded by the browser.
The code above works on another linux server i use, and I am baffled at the moment. Any suggestions regarding the DirectAdmin set up wrt to gzip file handling, would be received with delight. I am not intending to have dynamic compression; these are static files.