Htaccess    html   Php   javascript   Asp   css    maths  Past Questions

Htaccess guide & tricks Donate at flattr Flattr this





Alert! Connect with 10,000 Chating Online. Join Now

Turning On web page Compression


you can potentially reduce the file size of your served content by over 70%? by adding a simple code to your htaccess.

All it require is for the server to have mod_deflate or mod_gzip installed in your apache module.

You can check this by typing phpinfo(); in a php file and load it in your browser and it will display your server configuration.

if you have ZLib Support enabled, you are good to go. Once your server has the appropriate compression modules installed (mod_deflate or mod_gzip), you can decrease the file size of your pages by over 70% by just adding a single line to your .htaccess file.

SetOutputFilter DEFLATE



Once you've added this line, your server will compress all content that it sends to your browser. You can test the benefits out for yourself with the following online tool. If you don't have a URL you can try, simply use this site's URL instead. I have compression enabled to reduce the amount of data you have to download:

[ yes, you save around 77% in bandwidth! ] As you can see, the benefits are simply too good to pass up, so turn them on if you can.



What is a .htaccess File?

Custom Error Pages

IP Blocking

Change Non WWW URLs to WWW URLs

Turning On Compression using GZIP

SEO 301 Redirect

Change the Default Directory Page/index file

How to Stop Directory Listing

How to stop someone looking at your htaccess file

Password Protect a Directory

Control access at files & directory level

Modifying the Environment Variable

Implementing server Caching Scheme with .htaccess

Redirect browser to https (ssl)

Rewrite URLs using htacccess

Adding new MIME types)

Specify Upload file limit for PHP in htaccess

Disallow Script Execution

Change Charset and Language headers

Set Timezone of the Server (GMT)

Force "File Save As" Prompt and File download

Protecting a single file

Set Cookie using htaccess

Send Custom Headers

Blocking request based on User-Agent Header

Disable caching for certain file type

Hotlinking protection with .htaccess

Prevent hacks

Disable directory browsing

Rename .htaccess files to another filename

Change default Index page

Block unwanted visitor based on referring domain

Secure directories by disabling execution of scripts

All the tutorials on this site are free, you can copy and print the tutorials and code on this site, but you are not allowed to reproduce this information on another website.
 
 
Htaccess    html   Php   javascript   Asp   css    maths  Past Questions