1

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.

dreake
  • 13
  • 2

1 Answers1

1

If these are links you wrote yourself then they need to either be relative or have http in the front. The browser adds the site URL to relative links automatically.

//this becomes `www.site.com/www.site.com/home`
Href="www.site.com/home"

//these are proper format
Href="http://www.site.com/home
Href="/home"
Href="home" (from current directory)

This may not be it for you... But I have seen it happen a couple of times now for wordpress users.

mrtsherman
  • 39,342
  • 23
  • 87
  • 111
  • OK, I figured this myself earlier but the answer is correct. Full solution would be to set both `WP_HOME` and `WP_SITEURL` to `"http://".$_SERVER['SERVER_NAME']`. – dreake Sep 06 '11 at 12:11