Simple ‘Down for Maintenance’ Solution for Apache using .htaccess

I finally decided to create a maintenance page to use whenever I’m upgrading any of my sites. This solution was pretty simple.

I added two RewriteCond stanzas to my .htaccess, at the top of the file at the base of the site. The first rewrite handles the case where the maintenance page exists:

# If the maintenance.html page exists, redirect to that.
RewriteCond /full/path/to/site/system/maintenance.html -f
# Don't redirect if the maintenance page was requested.
RewriteCond %{REQUEST_URI} !/system/maintenance.html
RewriteRule ^.*$ http://blog\.coredump\.ca/system/maintenance.html [R,L]

If the maintenance.html file exists, it is displayed. What happens when the maintenance is complete? Well, I remove the maintenance.html page of course. To prevent anyone from seeing a 404 once maintenance.html has been removed, I added the following to .htaccess immediately after the previous stanza:

# If the maintenance.html page does not exist, redirect to the index.
RewriteCond /full/path/to/site/system/maintenance.html !-f
RewriteCond %{REQUEST_URI} /system/maintenance.html
RewriteRule ^.*$ http://blog\.coredump\.ca [R,L]

Now all I do whenever I bring the site down for maintenance is:

  1. copy maintenance.html into the appropriate location;
  2. perform the site maintenance;
  3. remove maintenance.html.

Isn’t that easy?

Other words

Nathaniel can also say sausage “autage”, bad (not that he is ever…), bed (refers to a nice red silk Pottery Barn comforter that the kids have claimed as theirs), scootch, stairs, medicine “medeeche”, juice (referring to Mommy’s beer when we went out for dinner the other night). Again, I’m sure there are words I’m missing, he learns new ones daily! Oh, we can’t forget buttons and buckle!

Nathaniel news

It’s been too long since the last blog…

Nathaniel and Alice had their latest vaccinations March 24th, the day after Don was laid off from Pason…

Nathaniel weighed 21 lbs, and is 75% for weight and 90th for height- the tall Murray!

I keep meaning to update Nathaniel’s progress- he knows so many words now!!

Here’s the list I can try to think of:

Car (has been saying this for months), Truck (“uck”), Plane (“pane”), Alice (“acss”), Mama, Daddy, Bye Bye, Toothbrush (“busch”), Uncle “unco”, Auntie “a-tee”, Cassie “ca-he”, Chase “teace”, meow meow (“mao mao”), puppy, mess, ba ba (for his bottle), wee, two, bo-bo, hug (“ug”), remote (“mote”), dragon (“a-gon”), rock (“ock”), happy “a-py”, no, phone “oan”, toes, hot, motorbike “mo-mo”, uckie, nose, eyes, blackberries “blackie”, noodles “noonoes”, apple “app-o”, ball, horse, owl, book (a new word this week), up, down, go. He learns new words almost daily. He loves to sit and read books, and will often gravitate to the bookshelf while Alice happily watches treehouse. His favorite books are the happy baby words ones, where he can point to things and say what they are. The most important word is “B”, for his blanket- his most worldly possession (I think he loves it more than me!)

And now he can put 2-3 words together, ie/ go-go-go (this is what he says as soon as he sees hockey on TV), bye-bye, no no, etc.

This week he also learned how to blow kisses–the most adorable thing!

And he knows all his body parts and proudly points to them when asked ie/where’s your fingers?

He is smart, and I kiss him all day long!!!