I have WordPress blog on server {IP}/blog.
Recently I've bought 2 domains and configured 2 virtual hosts in Apache for this blog. This works but all links on site are directing to old location {IP}/blog/link_href.
I've tried to change WP_HOME and WP_SITEURL to $_SERVER['SERVER_NAME'] but this leads to links like www.sth.com/www.sth.com/link with double.