I realized shortly after launching the update to my site, that I had broken every link Google had for me. I’ll go into the details below, but suffice to say I needed to fix this quick. After all, Google has indexed over 1,000 pages from my site.
First of, you’ll notice as you browse that my blog URLs have extensions now (html, xml, etc). I decided (against conventional wisdom) to add back extensions because I think they make sense: they describe to the user what kind of file is being served. If the link has .html appended to it, you’ll be getting an HTML file. If the link has .xml appended to it, you’ll be getting a flavor of XML (in this case RSS 2.0).
This decision made it possible for me to generate RSS feeds for 5 different views related to posts:
- All posts
- Posts for a section
- Posts for a year
- Posts for a month
- Posts for a day
So, the problem I had with Google was converting old links (with no extension) into the new format. This was accomplished using the Apache module mod_rewrite. Now, all requests for posts without a suffix will be redirected to the proper URL.