# This is a sample .htaccess file that you can use or modify for your own site. # All the stuff that enables gzip compression and long expire headers for better caching is under the "End Wordpress" line. # Note that this htaccess file only works on Apache 2 (because it uses mod_deflate. Apache 1 uses mod_gzip). If anyone submits an htaccess file that works for Apache 1 I'll post it. # Before you use this, BACKUP YOUR CURRENT HTACCESS FILE JUST IN CASE!!!!! # To use this file, drop it into your Apache 2 hosted site root directory, then rename it from htaccess.txt to just .htaccess # If you rename it on your local computer first it might disappear (files that start with dots are hidden files). # Of course if you've already got a customized .htaccess file or don't need the Wordpress stuff, just copy/paste the parts you need. # I've included most common mime types (js and ico files can have various mime types depending on your setup), but you might need to double check. Firebug and Yslow will tell you what mime type your host uses. # If I left anything out, or did something totally wrong here PLEASE LET ME KNOW SO I CAN FIX IT. # The contents of this .htaccess file are free and public domain from now until the end of the universe. Please use them however you see fit. # If you found this useful, please let me know or better yet, link to the post containing this file so others can use it. Thanks! # Hugs and kisses, NathanBowers.com # Working HTACCESS stuff starts here: Order deny,allow Allow from all # Turn off "browse folder" view of your site folders Options All -Indexes # BEGIN WordPress pretty URLs RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress # Below uses mod_deflate to compress text files. Never compress binary files. SetOutputFilter DEFLATE # compress content with type html, text, js, and css AddOutputFilterByType DEFLATE text/html text/plain text/css text/javascript application/javascript application/x-javascript # properly handle requests coming from behind proxies Header append Vary User-Agent # Properly handle old browsers that do not support compression BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html # Explicitly exclude binary files from compression just in case SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|pdf|swf|ico|zip)$ no-gzip # Set long expire headers for better browser caching ExpiresActive On ExpiresByType text/css "access plus 30 days" ExpiresByType text/javascript "access plus 7 days" ExpiresByType application/x-javascript "access plus 7 days" ExpiresByType application/javascript "access plus 7 days" ExpiresByType image/x-icon "access plus 7 days" ExpiresByType image/vnd.microsoft.icon "access plus 7 days" ExpiresByType image/png "access plus 30 days" ExpiresByType image/gif "access plus 30 days" ExpiresByType image/jpeg "access plus 30 days" ExpiresByType image/jpg "access plus 30 days" ExpiresByType application/x-shockwave-flash "access plus 30 days"