from: Apache htaccess google group
For Webmasters
Custom HTTP Headers
PHP htaccess tips
SEO Search Engine Friendly Redirects without mod_rewrite
mod_rewrite tips and tricks
Speed up your site with Caching and cache-control
Apache Authentication in htaccess
Security with Apache htaccess
SSL example usage in htaccess
Apache Variable fun (mod_env)
When site is Under Construction
Redirect everyone to different site except 1 IP
Redirect everyone to different site except 1 IP
Redirect Everyone but you to alternate page on your server.
Set the Timezone of the server
Set the Server Administrator Email
Turn off the ServerSignature
Force Files to download, do not display in browser
Process All .gif files with a cgi script
Process Requests with certain Request Methods
Make any file be a certain filetype
Use IfModule directive for robust code
Prevent Caching 100%
Remove IE imagetoolbar without meta tag
Add Privacy (P3P) Header to your site
Add a en-us language header and urf-8 without meta tags!
Using AddType
Using the Files Directive
Using the FilesMatch Directive
When php run as CGI
Use a custom php.ini with mod_php or php as a cgi
When php run as Apache Module (mod_php)
When cgi php is run with wrapper (FastCGI)
For single moved file
Redirect Home to new Domain
For multiple files like a blog/this.php?gh
Redirect Entire site to single file
Mostly .htaccess rewrite examples should begin with:
Check for a key in QUERY_STRING
Removes the QUERY_STRING from the URL
Fix for infinite loops
Require the www
Require no www
Redirect .php files to .html files (SEO friendly)
Redirect .html files to actual .php files (SEO friendly)
block access to files during certain hours of the day
Rewrite underscores to hyphens for SEO URL
Require the www without hardcoding
Require no subdomain
Require no subdomain
Redirecting Wordpress Feeds to Feedburner
Only allow GET and PUT request methods
Prevent Files image/file hotlinking and bandwidth stealing
Stop browser prefetching
Make a prefetching hint for Firefox.
htaccess time cheatsheet
Caching with both mod_expires + mod_headers
Caching with mod_headers
Caching with mod_expires
Require password for 1 file only
Protect multiple files:
Using the Apache Allow Directive in htaccess
Hope this helps!