A fresh mix of code snippets and tutorials

Category Archive: .htaccess

Posts about Apache and .htaccess

Page 3 of 4

Create .htaccess files on OS X and Windows

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.

.htaccess Force GET or POST Requests

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.

Set PHP Limits with .htaccess

A quick summary of some of the PHP limits that can be set via the .htaccess file.

Browse your local files via browser

Ultra-quick tip for viewing/browsing files on your local machine in any browser.

Whitelist POST access with .htaccess

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.

Protect .svn files with .htaccess

For those using subversion, here is how to protect your svn files with .htaccess.

Set X-UA-Compatible via .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.

Simple Ajax Chat .htaccess whitelist

In general, chat scripts are huge targets for malicious activity. My chat plugin, Simple Ajax Chat is no exception, and includes strong security measures to protect against attack. Aimed at the free version of SAC, this quick tutorial shows a simple Apache/.htaccess technique to further strengthen plugin security.

Quick KB/MB unit conversions

Working with .htaccess for stuff like file uploads, it’s frequently necessary to convert between kilobytes and megabytes.

Force download WMV with .htaccess

Everyone loves WMV! Not! Jokes aside, here’s what finally worked for me when trying to force download Windows Media Video (WMV) files.

Shortcut to WP Login

Back in January of 2011, Chris Coyier posted a sweet .htaccess technique for setting up Simpler Login URLs in WordPress. This is a follow-up technique that’s slightly improved..

Additional file-types for mod_expires

Here is a list of the most common file-types for Apache’s mod_expires, which is used for configuring expires headers for better cache control.