Skip to main content
MagentoSpeeding up

gzip compression breaking Magento admin

By July 26, 2010December 10th, 2014No Comments

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

Measured Designs gzip test

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.

Andrew Taylor

A senior UI designer with over 25 years of web design and web development experience working for some of the largest companies in the UK. An expert in all things Magento and WordPress.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.