Welcome to WebmasterWorld Guest from 54.147.217.76

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Compressing Using Mod Deflate?

mod_deflate, compression, apache

   
12:42 am on Apr 5, 2011 (gmt 0)



Hi,

I am trying to get compression to work on my Apache server. So far I have only gotten mod_deflate to work using my .htaccess file. My hosting provider told my that I can't use mod_gzip. How can I use the code below to compress .php documents as well?


<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>



If anyone has any other suggestions for compression that would be great.


Christian
11:50 pm on Apr 5, 2011 (gmt 0)



Does anyone have any input on this?

Christian
9:09 am on Apr 6, 2011 (gmt 0)

10+ Year Member



Generally .php outputs as text/html, so .php files will be compressed by this anyway.

You can use a server header tool to check the headers sent by the server when you request your php file and you can see what content type is returned. Include that if it is not covered in the list.
4:18 pm on Apr 6, 2011 (gmt 0)



Hi SEOtop10,

Using www.gidnetwork.com I tested the page and the content type came up as text/html. That content type is already in the code above. Hmmm, why isn't it working?

Christian
4:37 pm on Apr 6, 2011 (gmt 0)

10+ Year Member



How do you know it is not compressing the file? Have you checked the response headers? Can you paste them here?
4:53 pm on Apr 6, 2011 (gmt 0)



The test I'm using says it's not. I've include the testing site and url below.


Using: [gidnetwork.com...]

Tested url: (www.sutherlanddesignagency.com/careers.php)
4:57 pm on Apr 6, 2011 (gmt 0)

10+ Year Member



Can you also paste your .htaccess file? You need to change all references to your domain to example.com.
10:49 pm on Apr 7, 2011 (gmt 0)



Hi SEOtop10,

Below is my .htaccess file.



ErrorDocument 404 /errorpage.html

RewriteEngine on

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.html(\?[^\ ])?\ HTTP/
RewriteRule ^(([^/]+/)*)index\.html$ http://www.example.com/$1 [R=301,L]

RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>



Christian
2:34 pm on Apr 11, 2011 (gmt 0)



Hi,

If anyone had any suggestions on this that would be great.


Christian
3:16 am on Apr 12, 2011 (gmt 0)

10+ Year Member



Looks Ok to me. May be someone else might spot a problem.
4:53 pm on Apr 14, 2011 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Concurrent thread continues here [webmasterworld.com].