View Single Post
  #1 (permalink)  
Old 02-15-2007, 08:03 PM
Daniel Daniel is offline
Constant Pligger
 
Join Date: Feb 2007
Posts: 114
Downloads: 0
Uploads: 0
Thanks: 6
Thanked 0 Times in 0 Posts
Thumbs up FIX for gzip compression troubles, no .htaccess gzip compression method required

I am using dedicated server and as you know - I had lots of troubles enabling gzip compression on server. Savant helped me do it with htaccess method, but I noticed this method does not speed up site significantly (at least on my server). I found a way to enable gzip compression without htaccess method, and it works perfectly fine:

1st, uncomment AddEncoding:

Code:
#
AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
2nd, uncomment AddType and add AddOutputFilterByType:

Code:
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE application/x-httpd-php
AddOutputFilterByType DEFLATE application/x-javascript
3rd, add output filter (it will allow you to process content before it is sent to the client:

Code:
#
AddType text/html .shtml .php .php3 .js .js.gz
AddOutputFilter INCLUDES .shtml .php .php3 .js .js.gz
Now, it works fine without "www". I need to figure out how to make it work with "www".

Any suggestions? It should not be hard for experienced programmers to figure this out.

Update: Just use savant's htaccess method to rewrite base_url. Don't change anything. Just rename htaccess.default to .htaccess (no need to uncomment php_value auto_prepend_file etc). Make sure you have these lines:

Code:
## Remove these two lines if you have a sub-domain like  http://ashdigg.pligg.com  or http://localhost
## Keep if your site it like   http://www.pligg.com
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^\/?(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
##### Re-directing End #####
Reply With Quote
Sponsored Links
Check out the New Templates at the Pligg Pro Shop.