I'm going to provide you step by step tutorial of how you can simply make you site much more faster, you visitors more happy and cut down you bandwidth.
First, create (or open if it exists) the .htaccess file (in the root of your document) and add this 3 lines of code (anywhere):
- Code: Select all
<FilesMatch "\.(js|html|css)$">
SetOutputFilter DEFLATE
</FilesMatch>
then save and upload this file ( it must be named exactl .htaccess and must be placed in the root of your document, where your main index.php/index.html file is)
We are using mod_deflate because there is a better compression technology (about 10-20% better than mod_gzip).
TROUBLESHOTING:
->if your getting a big 500 error on your website after adding this, that means that your Apache don't have this mode installed. Plaese see http://www.forum.yourweb-life.com/php-f73/gzip-pages-with-php-t141.htmlfor GZIP-ing with PHP.
If you want to use mod_gzip, please add this code instead:
- Code: Select all
<Ifmodule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_can_negotiate Yes
mod_gzip_static_suffix .gz
AddEncoding gzip .gz
mod_gzip_update_static No
mod_gzip_command_version '/mod_gzip_status'
mod_gzip_keep_workfiles No
mod_gzip_minimum_file_size 500
mod_gzip_maximum_file_size 500000
mod_gzip_maximum_inmem_size 60000
mod_gzip_min_http 1000
mod_gzip_handle_methods GET POST
mod_gzip_item_exclude reqheader "User-agent: Mozilla/4.0[678]"
mod_gzip_item_exclude mime ^image/
mod_gzip_item_exclude file \.js$
mod_gzip_item_exclude file \.css$
mod_gzip_item_include file \.html$
mod_gzip_item_include file \.php$
mod_gzip_item_include file \.pl$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/html$
mod_gzip_item_include mime ^text/plain$
mod_gzip_item_include mime ^httpd/unix-directory$
mod_gzip_dechunk Yes
mod_gzip_add_header_count Yes
mod_gzip_send_vary On
</Ifmodule>











