List of Epigraphs¶
Each chapter opens with an epigraph drawn from a different author. This page collects them in one place, with notes on why each was chosen.
Preface¶
They stared at the branch. There wasn’t just one flowerout there, there were dozens, although the frogs weren’table to think like this because frogs can’t count beyondone.They saw lots of ones.—Terry Pratchett, Wings
Notes:
The frogs see “lots of ones” — individual problems without the bigger picture. The book teaches you to count higher: to see the patterns behind the individual redirects and rewrite rules.
Wings is the third book in the Nome Trilogy, also known as the Bromeliad, by Terry Pratchett. It tells the story of traveling far away to find home, and is one of our (Maria and me) favorite books. You should read it. It’s way better than this book. -rcb
Chapter 1: Regular Expressions¶
The first thing you learn in life is you’re a fool.The last thing you learn in life is you’re the same fool.—Ray Bradbury, Dandelion Wine
Notes:
Regular expressions are the first thing the book teaches, and the first place every reader feels foolish. You’ll return to them throughout your career and feel the same way again.
Every summer I read Dandelion Wine. It’s a bittersweet story about growing up, and learning, and losing, and I find something new in it every time. Hope you have the same experience with this book. -rcb
Chapter 2: URL Mapping¶
Some people are heroes. And some people jot down notes.Sometimes they’re the same person.—Terry Pratchett, The Truth
Notes:
Not every contribution is heroic. Some people write the documentation, maintain the maps, keep the config files clean. All skills are valuable.
I got involved in open source because I’m a writer, not a programmer. I stayed involved because that was celebrated, and because the communities can be delightful. I’m still not a programmer, although I tried to be for a few years. But this quote always reminds me that all skills are valuable. -rcb
Chapter 3: Introduction to mod_rewrite¶
In the high and far-off times the Elephant, O Best Beloved, had no trunk.
—Rudyard Kipling, The Elephant’s Child
Notes:
Before this chapter, you had no trunk — no mod_rewrite. The Elephant’s Child got its trunk by sticking its nose where it didn’t belong and having it stretched by a crocodile. Most people learn mod_rewrite the same way.
I used to read the Just So Stories to the kids when they were little, and I did all the voices. The Elephant’s Child was always a favorite. ‘Led go! You are hurtig be!’ Consider doing the voices while reading this chapter. -rcb
Chapter 4: RewriteRule¶
Quickly, bring me a beaker of wine, that I may wetmy brain and say something clever.—Aristophanes (attributed)
Notes:
The moment you sit down to write your first RewriteRule and need some liquid courage to say something clever. Perhaps apocryphal, but whatevs. -rcb
Chapter 5: Rewrite Logging¶
Oh, I have slipped the surly bonds of earthAnd danced the skies on laughter-silvered wings.—John Gillespie Magee Jr., High Flight
Notes:
Rising above the chaos to see clearly — which is exactly what the rewrite log gives you.
This poem celebrates finding the beautiful amidst the ugly. It was written by a fighter pilot who died in a mid-air collision over England in 1941, at the age of 19. I learned it in high school and it’s stayed with me ever since. -rcb
Chapter 6: RewriteRule Flags¶
My girl came to the studyand said Help me;I told her I had a time problemwhich meant:I would die for you but I don’t have ten minutes.—Brenda Hillman, Time Problem
Notes:
Every flag is a choice about how to spend your processing time. [L]
says stop here. [S] skips ahead. [END] says we’re done.
This poem always reminds me that our most valuable asset is our time, and we choose how to spend it. It’s always a choice, so choose wisely, and prioritize what actually matters. -rcb
Chapter 7: RewriteCond¶
Snore on in your front row seatLet not my voice disturb the wordless heaven your eyes have found—James Kirkup, To An Old Lady Asleep At A Poetry Reading
Notes:
RewriteCond checks whether anyone is paying attention before the rule fires. Sometimes the answer is no, and that’s fine — the request passes through untouched.
I won the Kenya national poetry competition reciting this one, and I think of it every time I’m on stage and see someone in the audience who isn’t quite paying attention. -rcb
Chapter 8: RewriteMap¶
And memories, he knew, were not glass treasures to bekept locked within a box. They were bright ribbons tobe hung in the wind.—Terry Brooks, The Talismans of Shannara
Notes:
RewriteMaps externalize knowledge — lookups, translations, redirects — into files and programs rather than locking them inside rewrite rules.
The Shannara books, by Terry Brooks, were what got me into reading high fantasy, and warrant re-reading regularly, although there are 33 of them, so that’s a pretty serious undertaking. -rcb
Chapter 9: Proxies and mod_rewrite¶
“His voice,” thought Will, “I never noticed. It’s the same color as his hair.”—Ray Bradbury, Something Wicked This Way Comes
Notes:
A proxy is the voice that speaks for the backend — and if it’s doing its job well, you never notice it’s not the real thing. Bradbury’s synesthesia captures that perfectly: the voice and the appearance blur together into something you accept without question.
If you haven’t read Something Wicked, you should. It’s best if you read it as a kid, and then again as an adult, but we can’t have everything. Did I mention how much I love Bradbury? -rcb
Chapter 10: Virtual hosts and mod_rewrite¶
When you’ve only got two ducks, they’re always in a row.—Rich Bowen
Notes:
If you’ve only got one virtual host, you don’t need virtual hosts. The complexity of mass virtual hosting only matters once you have enough ducks to worry about their arrangement.
Also, I’m a Jeep driver. You’ve seen those Jeeps with way too many ducks on their dashboards, right? Guess how many I have. -rcb
Chapter 11: Access control with mod_rewrite¶
When the dragons grow too mightyTo slay with pen or swordI grow weary of the battleAnd the storm I walk towardWhen all around is madnessAnd there’s no safe port in viewI long to turn my path homewardTo stop awhile with you—Rush, Madrigal
Notes:
Keeping the dragons out, and knowing when to stop fighting. The whole chapter is about access control, and the closing section is about when to put the sword down and use simpler tools instead.
And of course we have to have a Rush quote. If you’re a Rush fan you know that it’s practically impossible to choose just one. (Rest well, Neil) This is one of the most beautiful of Rush’s songs, and not much known outside of the fans. It expresses the beauty of having a true friend to rest with from the struggles of the world. -rcb
Chapter 12: Conditional Configuration¶
Any sufficiently advanced technology is indistinguishable from magic.—Arthur C. Clarke, Profiles of the Future
Notes:
The chapter where the config file stops being static and starts being
programmable. To someone used to plain directives, <If> expressions
and Define variables look like magic.
I met Clarke in Colombo, Sri Lanka, at ApacheCon Asia 2006. All I could think of to say to him was “Thank you for the stories.” -rcb
Chapter 13: Content Munging¶
On the Coast of CoromandelWhere the early pumpkins blow,In the middle of the woodsLived the Yonghy-Bonghy-Bo.—Edward Lear, The Courtship of the Yonghy-Bonghy-Bo
Notes:
Whimsical nonsense for a chapter about transforming content into something new — munging things into strange and wonderful shapes.
Lear’s nonsense was another staple for reading to the kids. The Jumblies and the Pobble were also favorites. Lovely brain candy after too much seriousness in the world. -rcb
Chapter 14: Recipes¶
Not to know that no space of regret can make amendsfor one life’s opportunity misused!—Charles Dickens, A Christmas Carol
Notes:
Jacob Marley’s ghost, lamenting wasted opportunity — a fitting epigraph for a chapter full of recipes to avoid common mistakes.
A Christmas Carol is another favorite book, and I read it every year too, and watch several of the movies. Patrick Stewart’s version is, of course, the best, closely followed by the Muppet one. -rcb