Using gzip to compress Magento files was widely recommended on blogs and forums but I ran into problems trying to implement it. The default gzip code in the .htaccess file didn’t work on my hosting and they recommended using their own code snippet. This then worked on the main site but blocked my Magento admin path.
The Magento admin page would then show the error; “No input file specified.”
Gzip compression breaking Magento
My hosting support recommended using addtional .htaccess files, so by placing the original .htaccess file in the admin directory, it should take precedence over the .htaccess file with the gzip code. Unfortunately this didn’t work but after a bit of searching I found a way to disallow a specific URL from being gzipped. Add this line to your .htaccess file, changing the path to reflect any folder name that you might have issues with.
# This rule disables mod_gzip if the request URI contains ‘/admin’
mod_gzip_item_exclude uri /admin
Gzip
Gzip is used to reduce the time it takes a browser to render a page by compressing textual data, such as html, CSS and Javascript. It is recommended by Yahoo!’s YSlow plugin and said to reduce response size by 70%.
Do let me know in the comments if this code snippet proved useful.