Posts categorized: Blog

Remove double forward slashes from URL

This tutorial explains how to remove two or more forward slashes // from URL requests. The technique uses the RedirectMatch directive of Apache’s mod_alias module. Simple copy-&-paste technique.

Target Apache versions with IfVersion

Apache provides a convenient way to conditionally check for its version number, which can be useful when writing directives that require specific modules and configurations. This tutorial explains how it’s done with a few simple examples.

Disable Directory Indexes

“Directory indexes”, aka “directory indexing”, “directory views”, or “directory listings”, are easy to disable using a small slice of .htaccess. This quick tutorial shows you how to make it happen in two seconds.

Book Update: Version 1.6

Version 1.6 now available! This update to the First Edition of .htaccess made easy brings many improvements, including fresh links, updated code, and new content. Here is a summary of changes:

Control Request Methods

Sites hosted on Apache servers can accept a wide range of request methods. For example, most developers are familiar with GET and POST requests. Other request methods are less common, such as DELETE, HEAD, and PUT. While many types of request methods are harmless or even beneficial, some of them are just unnecessary and serve […]