Forum Moderators: phranque
In that case, a simple bit of mod_rewrite code can be used:
# If client accepts compressed files
RewriteCond %{HTTP:Accept-Encoding} gzip
# and if compressed file exists
RewriteCond %{REQUEST_FILENAME}.gz -f
# send .html.gz instead of .html
RewriteRule ^(.+\.html)$ /$1.gz [L]
# If client accepts compressed files
RewriteCond %{HTTP:Accept-Encoding} gzip
# rewrite html requests to the compressed-file handler script
RewriteRule ^(.+\.html)$ /compressor.pl?file=$1 [L]
Just some ideas...
Jim
# If client accepts compressed files
RewriteCond %{HTTP:Accept-Encoding} gzip
# and if compressed file exists
RewriteCond %{REQUEST_FILENAME}.gz -f
# send .html.gz instead of .html
RewriteRule ^(.+)\.(css¦html)$ /$1.$2.gz [L]
I've modified it so it will do CSS aswell.
The website is hand done in HTML (like the old days), and I don't mind manually creating the gzipped versions.