pragnesh/zend-fw-head-compressor/master/public/.htaccess - Htaccess File

pragnesh/zend-fw-head-compressor/master/public/.htaccess

RewriteEngine On

### JS and CSS compressed files ###
<files *.js.gz>
    AddType "text/javascript" .gz
    AddEncoding gzip .gz
</files>
<files *.css.gz>
    AddType "text/css" .gz
    AddEncoding gzip .gz
</files>
# Check to see if browser can accept gzip files.
RewriteCond %{HTTP:accept-encoding} gzip
RewriteCond %{HTTP_USER_AGENT} !Safari

# 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 [QSA,L]

### Main block for rewrite rules ###
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

On Github License

Files

Download PDF of Htaccess file
HTTP_USER_AGENT, REQUEST_FILENAME

Comments

Apache