I needed to compress and send my CSS and JS and i found this tutorial and that i adopted exactly. However i obtain the following 500 error during my Server
Internal Server Error
The server experienced an interior error or misconfiguration and was not able to accomplish your request. Please contact the server administrator and tell them of times the mistake happened, and anything you may have done that could have triggered the mistake.
More details relating to this error might be obtainable in the server error log.
Listed here are this content of my
ErrorDocument 404 /error/index.php # pass the default character set AddDefaultCharset utf-8 # disable the server signature ServerSignature Off # set the server administrator email SetEnv SERVER_ADMIN email@example.com # secure htaccess file <Files .htaccess> order allow,deny deny from all </Files> # BEGIN Compression and Caching Script per http://wordpresspartner.com # This calls the ‘compress-css.php’ and ‘compress-js.php’ files <ifModule mod_rewrite.c> RewriteEngine on RewriteRule ^(.*\.(css))$ compress-css.php?file=$1 RewriteRule ^(.*\.(js))$ compress-js.php?file=$1 </ifModule> # This enables caching <ifModule mod_headers.c> <filesMatch “\\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$”> Header set Cache-Control “max-age=2592000, public” </filesMatch> <filesMatch “\\.(xml|txt)$”> Header set Cache-Control “max-age=216000, public, must-revalidate” </filesMatch> <filesMatch “\\.(html|htm|php)$”> Header set Cache-Control “max-age=1, private, must-revalidate” </filesMatch> </ifModule> # End Compression Script
- What's wrong?
- How do you instantly compress my JS and CSS?
- Also i've an SWF. Can one compress that? How must i acheive that?
- Even when i wish to compress individual files only, while keeping their
.cssextension how do you do this?
For which I can tell, you'll need the compress-css.php and compress-js.php files too to compress individuals kinds of files. Apache can perform by using a module known as mod_deflate, you shouldn't have to pass through the files to some php script. I'll strongy recommend you accomplish that rather. Stick to the documentation here to learn to get it done. SWF files are more difficult, since it is a binary format. I haven't any knowledge about tools that allegedly compress SWF files. Just leave them because they are and hang cache headers properly (your replicated .htaccess do this, more info here).