gzip page htaccess compression rewriterule parameters

gzip page htaccess compression

Htaccess redirect

Learn gzip page htaccess compression rewriterule flags , syntax using the sample example below.

Turning On gzip page Compression (aka Reducing Your File Size!)

Did you know that you could potentially reduce the file size of your served content by over 70%? I am not kidding. If your server has the appropriate compression modules installed (mod_deflate or mod_gzip), you can decrease the file size of your pages by over 70% by just adding a single line to your .htaccess file:
SetOutputFilter DEFLATE
Once you've added this line, your server will compress all content that it sends to your browser.

Compress output using GZIP

Add following snippet into your htaccess file and compress all the css, js, html files with GZip compression.

<IfModule mod_gzip.c>
    mod_gzip_on       Yes
    mod_gzip_dechunk  Yes
    mod_gzip_item_include file      \.(html?|txt|css|js|php|pl)$
    mod_gzip_item_include handler   ^cgi-script$
    mod_gzip_item_include mime      ^text/.*
    mod_gzip_item_include mime      ^application/x-javascript.*
    mod_gzip_item_exclude mime      ^image/.*
    mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*

Above code works only if mod_gzip module is enabled in your webserver. You may want to add following snippet if your webserver provides mod_deflate support.

    SetOutputFilter DEFLATE
      SetEnvIfNoCase Request_URI  \
        \.(?:gif|jpe?g|png)$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI  \
        \.(?:exe|t?gz|zip|gz2|sit|rar)$ no-gzip dont-vary

If your webserver does not support mod_deflate then you may want to use following snippet.

<FilesMatch "\.(txt|html|htm|php)">
    php_value output_handler ob_gzhandler


gzip page htaccess compression syntax

gzip page htaccess compression code on this is provided for your study purpose, it will guide you to know how to use mod_rewite to create .htaccess files on the apache servers. use it to practice and train your self online

All the tutorials on this site are free, the page code is provifed for you to use it to practice, if you want to help to improve and maintain this work, you can donate to us on.

Htacess tutorial guides withexamples and easy steps to set ip up on your server.

Htaccess Generator

Htaccess force file save

ip blocking

adding new mime types and set timezone

cache control no cache and cache public

gzip page compression

block all bad robots

hotlink protection

redirect www to non www

stop directory listing

hide .

block and allow referrer

changing home directory page

upload_max_filesize limit

file access deny control

password protect a directory

hot to create file

php 301 redirect

custom error page

301 redirect

prevent hack

prevent directory listing

set cookie domain authentication

modifying the environment variable

All the tutorials on this site are provided for free. You can copy and print the tutorials and code on this site, but you are not allowed to reproduce this information on another website. All rights reserverd 2012

Copywright © 2013 www.htaccessredirect301.com Site created By prince Ejike Google+