开发者

Wordpress links on multiple domains

开发者 https://www.devze.com 2023-04-02 07:02 出处:网络
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}/

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 $_SER开发者_StackOverflowVER['SERVER_NAME'] but this leads to links like www.sth.com/www.sth.com/link with double.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号