I migrate a lot of WordPress installs from a localhost to the beta server and then to production. It's easy enough to update the URLs in _options and guids in _posts, but the one thing that irritated the hell out of me was the rewrite rules. WordPress caches the rewrite rules within _options; if you've migrated a WordPress you'll notice links are broken even though .htaccess is fine.
Simply find "rewrite_rules" in _options table and clear out it's value - badda bing. You could just re-save via Permalinks, but this is just as easy if you're already in there.