Note to self: If you’re changing the canonical domain of a WordPress site, keep in mind that WordPress itself redirects all requests to the domain entered in Settings.
I have decided to change my practice and use www. for all my websites. (See why using www. is a good idea.)
I logged into my DNS provider to edit the settings for this site so that any requests for designerandgeek.com would be redirected to www.designerandgeek.com. I waited a while for the DNS records to update, and reloaded the site. To my dismay, the browser complained that it had encountered a redirect loop.
Maybe there was something in Apache’s virtual host setup that would be causing another redirect? Nope. I even checked .htaccess in the site’s root directory, but found nothing there either.
As I was typing up a forum post asking other web geeks for advice in this matter, I was deliberating whether I should mention that it was a WordPress site—and that was when it hit me: WordPress does its own redirection if the requested domain doesn’t match exactly what’s set as the site’s domain name in its database.
The funny part is that I’ve encountered this issue many times before, but apparently it doesn’t happen often enough to stick in my mind.
I logged into phpMyAdmin, searched the wp_options table for rows containing http://designerandgeek.com and edited the found rows by adding www. before the domain name.