I've been a user of the "allow forcing preferred host name" setting for some time now, but I've always been a bit leery of it, and I finally got bit. It took me some time and research to fix it once it was broken, and since my site was down for the duration, I figure I should recount it here in the hope that it helps someone.
The preferred host name setting is documented here:
http://www.mojoportal.com/forcing-a-preferred-host-name.aspx
The idea is that since a user may visit your site through multiple names ("site.com" as well as "www.site.com"), this isn't great for search optimization since the same page may have two search entries, diluting it. I don't know if this is also fixed by canonical urls, but I'm not that savvy and it sounds like a good idea to force the full name anyway since I run multiple sites on my installation.
You can use either this setting or URL rewriting to redirect users to the full preferred name of your site. Since I don't have URL rewriting on, I chose this setting.
The problem is, if you get the setting wrong, you take your site down since it always redirects to a wrong name. Since the setting is done through the admin interface on the site itself, you've basically screwed yourself and have to find the setting in the database directly, or turn it off in web.config.
I won't go too in-depth on how I ended up setting it wrong. I'm not just an idiot. ;) Basically I was setting up a virtual machine clone of the site and trying to adjust the setting for the clone, and the redirect kicked me to my main site. I failed to notice that and set the main sites preferred host name to be that of the clone.
Thinking about it, that's naturally a problem with any clone, it's always going to kick you to the main site automatically. So you have to turn the feature off in the web.config of the clone before doing *anything* to the clone.
So my main site went down. Took me a few minutes for the report to come in, because it looked ok to me (it was redirecting to the internally available clone). Once I figured out what was going on, I turned off the feature in web.config and the site came back up.
But I wanted the feature on for my main site. Unfortunately, when you turn it off, the configuration field in the site settings goes away, so now I couldn't put it back to its former value. It would be nice if the configuration field were still there, with perhaps a checkbox to turn the feature off and on.
As it stood, I couldn't reset it from the user interface, so I had to track down the field in the database, as the documentation page mentions. Unfortunately, the documentation doesn't mention where that field is.
I could've asked on the forum, but since I already have the source, I did a few searches before I figured out that it's in the dbo.mp_sites table as apikeyextra5. Reset it to the desired value and restart the site and voila.
Hopefully this saves someone else a few desperate minutes.