Free Web Hosting Forum
Go Back   Free Web Hosting Forum > Website Building > Web Design and HTML
Reload this Page Cant get .htaccess to compress with Gzip or Deflate
Reply
 
Thread Tools Display Modes
(#1)
Old
johnLpool's Avatar
johnLpool johnLpool is offline
Junior Member
johnLpool is on a distinguished road
 
Posts: 4
Join Date: Feb 2015
Location: Liverpool, UK
Default Cant get .htaccess to compress with Gzip or Deflate - 02-28-2015, 01:29 PM

Hi All,

I have tried every option and script to try and get the .htaccess file to compress with both Gzip and Apache DEFLATE to no success, also the Expire code also does not work here is my code:
Code:
RewriteBase /
RewriteEngine on

RewriteCond %{HTTP_HOST} ^haemochromatosis-northwest\.net76.net$ [NC]
RewriteRule ^(.*)$ http://www.haemochromatosis-northwest.net76.net/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.html$ http://www.haemochromatosis-northwest.net76.net/$1 [R=301,L] 
RewriteCond %{HTTP_USER_AGENT} libwww-perl.* 
RewriteRule .*  [F,L]
php_value auto_prepend_file none
php_value auto_append_file none

AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/php
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/php
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ##
hope its a mistake in my coding,

Any help is respected thankyou.
Reply With Quote
(#2)
Old
fuzzler fuzzler is offline
Junior Member
fuzzler is on a distinguished road
 
Posts: 21
Join Date: Feb 2015
Default 03-01-2015, 12:33 PM

Bump. Would be nice to see somebody with an insight here.
Reply With Quote
(#3)
Old
johnLpool's Avatar
johnLpool johnLpool is offline
Junior Member
johnLpool is on a distinguished road
 
Posts: 4
Join Date: Feb 2015
Location: Liverpool, UK
Default 03-01-2015, 03:25 PM

@fuzzler, yep waits in anticipation.
Reply With Quote
(#4)
Old
johnLpool's Avatar
johnLpool johnLpool is offline
Junior Member
johnLpool is on a distinguished road
 
Posts: 4
Join Date: Feb 2015
Location: Liverpool, UK
Default 03-01-2015, 05:12 PM

Hi all have simplified the code all works but for the Canonicalization of the domain name and id address.

Ant help in this matter is much appreciated
Reply With Quote
(#5)
Old
johnLpool's Avatar
johnLpool johnLpool is offline
Junior Member
johnLpool is on a distinguished road
 
Posts: 4
Join Date: Feb 2015
Location: Liverpool, UK
Default 03-01-2015, 05:13 PM

code

php_flag zlib.outpu
Code:
t_compression on
php_value zlib.output_compression_level 2
php_value auto_prepend_file none
php_value auto_append_file none


RewriteEngine on

# Add Caching.
<FilesMatch ".(ico|jpg|jpeg|png|gif|js|css|swf|html|php)$">
    Header set Cache-Control "max-age=3600"
</FilesMatch>

RewriteCond %{HTTP_USER_AGENT} libwww-perl.* 
RewriteRule .*  [F,L]

RewriteCond %{HTTP_HOST} ^31\.170\.162\.163
RewriteRule (.*) http://haemochromatosis-northwest.net76.net/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.haemochromatosis-northwest.net76\.net$
RewriteRule ^/?$ "http\:\/\/haemochromatosis-northwest.net76\.net\/" [R=301,L]
Reply With Quote
Reply

Tags
.htacces, deflate, expiration, gzip

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com