What is .htaccess?
.htaccess is a configuration file for use on web servers running the Apache Web Server software. When a .htaccess file is placed in a directory which is in turn ‘loaded via the Apache Web Server’, then the .htaccess file is detected and executed by the Apache Web Server software. These .htaccess files can be used to alter the configuration of the Apache Web Server software to enable/disable additional functionality and features that the Apache Web Server software has to offer. These facilities include basic redirect functionality, for instance if a 404 file not found error occurs, or for more advanced functions such as content password protection or image hot link prevention.
Contents
- What is .htaccess?
- How to use .htaccess
- Error documents
- Redirects
- Password protection
- Deny visitors by IP address
- Deny visitors by referrer
- Hot link prevention techniques
- Blocking offline browsers and ‘bad bots’
- DirectoryIndex uses
- Adding MIME types
- Enable SSI with .htaccess
- Enable CGI outside of the cgi-bin
- Disable directory listings
- Setting server timezone
- Changing server signature
- Preventing access to your PHP includes files
- Prevent access to php.ini
- Forcing scripts to display as source code
- Ensuring media files are downloaded instead of played
- Setting up Associations for Encoded Files
- Preventing requests with invalid characters
- Useful Resources
Contents
- What is .htaccess?
- How to use .htaccess
- Error documents
- Redirects
- Password protection
- Deny visitors by IP address
- Deny visitors by referrer
- Hot link prevention techniques
- Blocking offline browsers and ‘bad bots’
- DirectoryIndex uses
- Adding MIME types
- Enable SSI with .htaccess
- Enable CGI outside of the cgi-bin
- Disable directory listings
- Setting server timezone
- Changing server signature
- Preventing access to your PHP includes files
- Prevent access to php.ini
- Forcing scripts to display as source code
- Ensuring media files are downloaded instead of played
- Setting up Associations for Encoded Files
- Preventing requests with invalid characters
- Useful Resources