Month: May 2016

Serving Custom Error Pages From Apache

At work, we are in the process of retiring an old password management web site. We want to direct users to the new site, and I don’t particularly want to handle each possible entry point an individual may have bookmarked. It seemed a lot quicker and easier to just move everything out of the directory and throw up a custom 404 page.

I am certain that I’ve used just “ErrorDocument ### /file.xtn” in Apache configurations to serve custom error pages, but when I set this up in our staging environment … I got the generic 404. Three days of Googling and reading Apache documentation later, and I have a configuration that actually serves a custom page when error 404 is encountered:

        ErrorDocument 404 /customized-404.html
        <Files "customized-404.html">
        <If "-z %{ENV:REDIRECT_STATUS}">
            RedirectMatch 404 ^/customized-404.html$

Voila, a pretty page that doesn’t in any way indicate 404 / not found / etc but rather says “hey, this web site is being retired. please go over yonder to manage your password.”.

Sometimes, math *is* hard

A recent meeting included a call back to “math is hard barbie” — back in 1992, Mattel produced a ‘talking’ Barbie that (among other phrases) said “math class is tough”. They ended up recalling the doll – a process which I assume cost the company quite a bit of money. And bad press. As a sophomore in high school, I didn’t understand the controversy. I was concurrently taking both Algebra 2 and Geometry (allowing me to complete two years of Calculus at graduation), so I had some experience with math classes.

The thing that struck me — the actual phrase is not untrue. Sometimes math class was hard. As someone with hand-eye coordination issues, art class was hard too. As someone who is tone deaf, music class was really hard. People who take offense at someone declaring something to be ‘hard’ have themselves declared difficult things as somehow negative. Not worth doing. I understand that the offense was people familiar with existing stereotypes extrapolating the statement to mean “girls think math is hard and girls avoid difficult academic subjects” or “females think math is hard because their brains don’t work that way and males have an innate advantage”.

I worry that we’re selling people false hope by refusing to tell them that something is hard. At some point, you’re going to encounter reality. I studied theoretical physics – gravitation, specifically gravitational phenomenon brought about during binary black hole collisions. Had someone told me it was going to be a super easy way to earn money – head into a computer lab for a few hours a day, drink some coffee, do a little typing, and head home … wow, what a shock my first day would have been. Why don’t we work on teaching people that a lot of things are hard. And each person makes their own effort:reward analysis. Raising chickens is a lot harder than picking a carton up at the grocery store; but if you like fresh eggs, or if you like to ensure the welfare of the animals providing your eggs, if you want to avoid using fossil fuels to transport your food, or if you just want to be involved in the process of generating your food … you decide to get some chickens. If you want to understand the mechanisms of the universe, you learn the math and physics. You do the research.