[Resolved] .htaccess Gzip

#1
Hey,

I was wondering what I'd need to stick in .htacces to gzip the regular JS/CSS? It's intended to be used on Wordpress if that makes any difference.

EDIT: And also how do I add expires on the files.

Cheers
 
Last edited by a moderator:

NiteWave

Administrator
#2
gzip js/css is automatically done by lsws, you can config expires through web admin console or using apache's ExpiresByType, ExpiresDefault directives.
 
#3
I can confirm that CSS is sent gzip'd, but no matter what I try for JS, it does not get compressed. I tried working around it by prepending a PHP script, but the content-type remains text/html even if I send a header stating otherwise.

The <FilesMatch> .htaccess directive appears to void auto_prepend_file, but setting Expires works for JS files using <FilesMatch>. Now I'm out of ideas. I've Googled and searched these forums specifically, but I still couldn't find a definitive answer.

Has someone experienced this issue before, and has anyone successfully fixed it? Thanks.
 
#5
Ah, I'd seen that thread in the search results but couldn't mess with the configuration because this was on shared hosting.

In the end, yes, that worked. My host was accommodating enough to make the change for me. Thank you.
 
Top