Fixing Pligg gzip technique error
I am proud to announce the launch of the new social bookmarking sites ShowUs. ShowUs is a social bookmasking site, where you can share and votes any interesting information collected around the web. You can promotes any interesting information from your blog as well. Currently ShowUs accommodates 8 news categories where you can place any related news and information. Just show to us what you find and we will votes for your news.
Since I’d like to push the site performance to the higher level, several tweak has been applied. The Gzip Technique were supposed to boost the site loading but unfortunately it didn’t work out of box. The standard instruction to activate the gzip technique gives the 500 error on ShowUs server. So far the problem was on PHP commands (php_value auto_prepend_file …) that can’t go in an .htaccess file.
Eventually I have to use another way to activate gzip feature on my server. The workaround is to create a php.ini in your site root, and add the following 2 lines:
auto_prepend_file=/home/path/public_html/begin_gzip.php
auto_append_file=/home/path/public_html/end_gzip.php
Then I add the following code on .htaccess file
<files *.js.gz>
AddType “text/javascript” .gz
AddEncoding gzip .gz
</files>
<files *.css.gz>
AddType “text/css” .gz
AddEncoding gzip .gz
</files>
RewriteEngine on
#Check to see if browser can accept gzip files.
ReWriteCond %{HTTP:accept-encoding} gzip
RewriteCond %{HTTP_USER_AGENT} !Safari
#make sure there’s no trailing .gz on the url
ReWriteCond %{REQUEST_FILENAME} !^.+\.gz$
#check to see if a .gz version of the file exists.
RewriteCond %{REQUEST_FILENAME}.gz -f
#All conditions met so add .gz to URL filename (invisibly)
RewriteRule ^(.+) $1.gz [QSA,L]
Now my ShowUs Social Bookmarking is gzipped and its loading time decreased significantly. Hopefully the high performance would attract more user and visitors. If you wanna join as the member so register yourself today and start showing us all you’ve got.
Post from: My Daily OpinionFixing Pligg gzip technique error