My most popular blog post works again

I checked my stats today and discovered that by far the most popular page on my website is this one: Some Rules Kids Won’t Learn in School (by Charles J. Sykes).

Unfortunately, the referral URL still has the (very) old Simple PHP Blog URI, and my default .htaccess rule naturally points all 403 and 404 errors to the home page.

This was an exercise in .htaccess redirect, surely?

Well, no. As it turns out, redirect isn’t a fan of query strings, and the referring URI is http://rabryst.ca/blog/index.php?entry=entry060928-084532.

Thanks to some handy Bingle-Fu, I was able to find a StackOverflow answer that solves this very problem.

Along with another URI that was already not working in my .htaccess, I was able to fix both links, and now the rewrites look like this:

RewriteCond %{QUERY_STRING} ^p=754$ [NC]
RewriteRule wp\/$ http://rabryst.ca/2008/04/why-arnold-cant-be-president/ [L,R=301]
RewriteCond %{QUERY_STRING} ^entry=entry060928-084532$ [NC]
RewriteRule blog\/index\.php$ http://rabryst.ca/2006/09/charles-j-sykes-some-rules-kids-wont-learn-in-school/ [L,R=301]

Let’s work together to relink the web!