| mod_rewrite, frequently called the “Swiss Army Knife” of URL manipulation, is one of the most popular—and least understood—modules in the Apache Web Server’s bag of tricks. In this chapter we’ll discuss what it is, why it’s necessary, and the basics of using it. For many people, mod_rewrite rules, and regular expressions in general, are magical incantations that they mutter over their website to make it do wondrous things. If the results are not quite what they wanted, they’ll add a pinch of this and a smidgen of that, in the hopes that doing so will nudge it in the right direction.
The goal of this book is to assist you in moving to a place where crafting a rewrite rule set is a scientific process, with predictable results. You’ll know what difference a particular change will make, and you’ll be able to determine, by reading a rule that has been handed to you, what it will do or why it’s not doing what it’s supposed to do. |