tags:

views:

57

answers:

1

hi,

im trying to include css.gz from external source, but still not works on all browsers

<link rel="stylesheet" type="text/css" media="all" href="http://www.website.com/style.css.gz" />

i dont know what is the problem

(my web server: nginx, and test server: apache)

thanks

+1  A: 

If you have access to the .htaccess file you can use this script to gzip css only to browsers that support it:

# This uses mod_deflate, which is pretty standard on Apache 2.  Loading
# mod_deflate looks like this:
#
#   LoadModule deflate_module modules/mod_deflate.so
#
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \\bMSIE !no-gzip !gzip-only-text/html

See the original post: http://stackoverflow.com/questions/1245889/htaccss-file-to-allow-safari-other-browsers-to-open-gzip/1245948#1245948

freyrs