Apache .htaccess recipes, tips and tricksPosted in Apache -
This is a summary post containing a list of the articles from this blog containing recipes, tips and tricks for using Apache's .htaccess files.
- password protecting a directory
- password protection, but allowing access from a specific IP address
- remove password protection from a subdirectory or file
- password protect a hotlinked file
IP address restriction
- disable PHP in a directory
- disable PHP short tags
- parse .html files as PHP
- set PHP configuration options
Posts using mod_rewrite
- setting 503 "Service Temporarily Unavailable" headers
- using mod_expires to control browser caching
- compressing files with mod_deflate
Changing the .htaccess filename to something else
It's possible to change the filename used for htaccess files to something else, although you will need access to the server configuration to be able to set this in either the main config or on a virtualhost by virtualhost basis. It can be useful for having a different .htaccess file for your local development box. Read the post changing the .htaccess filename in Apache for more details.
Offsite articles with more htaccess tips and tricks
I've only got one at the moment, but if I find any other useful ones I'll add them here.
- 17 useful htaccess tricks and tips at queness.com