Posts categorized: Blog

Page 2 of 11

Access Control for Apache 2.4 (and 2.2)

Throughout the book, I explain various techniques for controlling access to web pages. For example, if you are getting hit with an attack from a specific range of IP addresses, you can add directives to block them based on the host address or other variables. It is a common technique that I’ve discussed numerous times. […]

Disable ETags

This tutorial explains how to disable ETags completely. In many cases, sending ETag headers negatively impacts performance, as explained by the wizards at Google and Yahoo. This tutorial explains how to disable ETags via .htaccess for your Apache-powered website. Two copy/paste steps and done. Estimated time required: 5 minutes.

Commenting your .htaccess code

Commenting your .htaccess code is an important part of staying organized. Here are some quick tips and best practices for writing comments in your .htaccess file (or the Apache server config file).

Add, Remove, or Change File Extensions with .htaccess

A reader recently asked how to add or remove the .html file extension from various URLs. The solution of course is found in Apache’s miraculous rewrite module, mod_rewrite. Using a few well-written RewriteRule directives in the htaccess file of your site’s root or target directory, modifying file extensions in URIs is relatively simple. This tutorial […]

How to Block IP Address with .htaccess

Quick post today showing some different ways to block visitors via their IP address. This can be useful for a variety of reasons, including stopping some stupid script kiddie from harassing your site, or preventing some creepy stalker loser from lurking around your forums, or even silencing the endless supply of angry trolls that never […]