Category Archive: .htaccess
Posts about Apache and .htaccess
Two quick code snippets for compressing your file output with Apache’s mod_deflate (gzip). Compressing your content is a great way to improve performance by decreasing the amount of data that is sent to the client.
Here is a quick .htaccess snippet that will force files to download instead of displaying in the browser. This method works for any site running on an Apache server.
Here is an .htaccess template for displaying a customized directory with file view enabled, such that all files except for those indicated are displayed as a list.
Here are some examples of how to use .htaccess to protect any sensitive files on the server.
This .htaccess snippet can be used to restrict the total size of the HTTP request body sent from the client.
This is a quick tutorial on how to create .htaccess files on Windows (PC) and OS X (Mac). This post also explains a bit about how .htaccess files work, and how to view them on various operating systems.
Here is how to force all HTTP requests to be either GET or POST. Easy to modify technique can be used for other types of requests as well.
A quick summary of some of the PHP limits that can be set via the .htaccess file.
Ultra-quick tip for viewing/browsing files on your local machine in any browser.
Here is how to whitelist POST requests for a specific file. For example, you can protect chat, forum, and other heavily targeted scripts from malicious acitivity.
For those using subversion, here is how to protect your svn files with .htaccess.
It’s relatively well known that you can set X-UA-Compatible headers with HTML.. here is how to do it with a bit of .htaccess.