Sunday, May 24, 2009

Need a Good Shot of the Atlanta Skyline?

Last night I went to a friend's party over in Vinings. It was a fun night because 1) I have some great friends, 2) we had a great time talking and catching up and 3) I had to find the place first!

I have had to become more adventurous while at college, especially after getting a car, and I enjoy the occasional adventure, even when it takes me around/into Atlanta's heart. It took four tries to get to the correct community (there were three gated entrances), but I eventually made it in.

One thing that surprised me was the surreal view of Atlanta that I got a glimpse of in my rear-view mirror. Atlanta was just sitting there, a cluster of towers rising up from the ground. I'm not sure at the moment if it was Buckhead or Downtown that I actually saw, but it was amazing anyway.

Looking at the hard facts, Wolfram Alpha says that Atlanta is 1,050 ft. and Vinings is 915 ft. So, it doesn't make sense that you could get such a great view of the city when you're lower than it...but however the facts come out, the view is still there!

Of course, when I look it up on Google Maps' "driving view" to show you, the weather is cloudy and hazy! The last time I took a good shot of the city, I was in a Cessna 172P looking east from the tail of the plane, but it was getting dark and the city was almost too hazy for a good shot...and I was behind an old scratched-up window.

So, today's lesson: if you ever need a photo of Atlanta, you know where to go!

Monday, May 18, 2009

How WordPress URLs Work

Ah, ha! How silly I feel now that I know the truth. I've been trying to understand how WordPress URL rewriting works, thinking incorrectly that it relied on Apache's mod_rewrite to do the dirty work. That is, however, not the case!

I've googled it ("how do WordPress URL rewrites work?") many a time, but never got a clear answer. I wonder if Wolfram Alpha knows now :P

WordPress does rely on mod_rewrite to invoke index.php, but doesn't use it to do any of the rewriting itself. The .htaccess file that WP uses contains this:


<ifmodule>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</ifmodule>


The !-f and !-d conditions instruct Apache to rewrite "whatever isn't an already-existing File or Directory." Just FYI, the [L] flag means, "this is the Last rule."

This gives me hope. Now, I understand that it is actually possible (because it's in practice) for me to parse and rewrite my own URLs. Doing my own URL processing is starting to make a lot of sense for a project that is right now a bunch of hen-scratch on paper.