My Google Secrets
Successful Websites Featured
Seo Success Tips for Fast Rankings in Google

How to Boost Your Site in Google


Fast Web Pages: Coding Your .htaccess File For Faster Load Times

On Apache? Code a ".htaccess" File to Compress Data, Images, Files

A lot of web hosting companies, Godaddy being one of them, use Apache servers to host countless numbers of websites. For the many companies out there on this kind of hosting or similar hosting, a ".htaccess" file can be added to the root folder of a website, with a small block of code that tells the browser to compress the data within each web page.

This entire step takes 5 minutes. First, you need to create a blank ".htaccess" file, then use your mouse and keyboard to copy some free code from the web for "compressing web page data within a .htaccess file", then paste that code into your .htaccess file, then "save" the file, then upload it to your website's root folder.

Sound complicated? It's not. You may even have a friendly tech support guy or gal at your web hosting company who can install one of these for you, free of charge. It doesn't hurt to ask.

How to Create a .htaccess file

You can create a .htaccess file on your local computer or on the server.

If you're on Windows, use Notepad to open a blank document, and then save the file as ".htaccess" (please note you may have to select "All Files" within Windows Explorer so that the .htaccess is visible on your hard drive).

On Mac, the file is hidden and you won't be able to see it in the Finder. In this case, open up your FTP program, and then go to the root folder of your web page on your hard drive and look for it there within the FTP program. When you find it, now you can upload it to your root folder where your website is hosted (root folder is the same folder that your home page or index.html page resides in typically; having problems? Call your webhost's tech support to walk you through this!)

Compression Code for Your .htaccess file

# compress text, HTML, JavaScript, CSS, and XML
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
Copy and paste the above code into that blank .htaccess file, save it, then FTP it to your website's root folder.

Just like that, with less than five minutes of work, you've just completed one more step toward making your web page load considerably faster. With each change you make, test your website using Google's Speed Page Test Tool and or GTMetrix linked to in previous paragraphs.

Code for your .htaccess file that tells your visitor's browser to cache web page files

# cache images and flash content for one month

Header set Cache-Control "max-age=2592000"

# cache text, css, and javascript files for one week

Header set Cache-Control "max-age=604800"

# cache html and htm files for one day

Header set Cache-Control "max-age=43200"

ExpiresActive On
ExpiresByType image/jpg "access 1 month"
ExpiresByType image/jpeg "access 1 month"
ExpiresByType image/gif "access 1 month"
ExpiresByType image/png "access 1 month"
ExpiresByType text/css "access 1 week"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 week"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 month"
ExpiresDefault "access 2 days"


Members FAQS About Contact Affiliate Program News Join Now

© 2017, All rights reserved.

No portion of this website may be copied or reposted and is protected by the Digital Millennium Copyright Act. Any plagiarism of this website or copyright violations will be prosecuted to the fullest extent of the law.

SEO Success Tips in