Reputation: 1905
I'm looking for a simple one line code that will use gzip to compress css, html, js, and php files on the web server. How can I do this with the .htaccess file or php.ini file? (My css and js files are in seperate folders in the root directory)
Upvotes: 2
Views: 2900
Reputation: 784968
You're most likely looking for mod_deflate module in Apache. Enable it in your httpd.conf
and also enable .htaccess then add this code in your .htaccess under DOCUMENT_ROOT:
<FilesMatch "\\.(js|css|html|htm|php)$">
SetOutputFilter DEFLATE
</FilesMatch>
Upvotes: 0