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 .htaccess file:

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 bedupako@gmail.com

# secure htaccess file
<Files .htaccess>
 order allow,deny
 deny from all

# 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


# 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 “\\.(xml|txt)$”>

Header set Cache-Control “max-age=216000, public, must-revalidate”


<filesMatch “\\.(html|htm|php)$”>

Header set Cache-Control “max-age=1, private, must-revalidate”



# End Compression Script
  1. What's wrong?
  2. How do you instantly compress my JS and CSS?
  3. Also i've an SWF. Can one compress that? How must i acheive that?
  4. Even when i wish to compress individual files only, while keeping their .js/.css extension 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).