简体   繁体   中英

I have two website domains, A and B. Can I switch the domains so that A's content moves to B, and vice versa?

For context, these are both blogs running on WordPress .

They are running different themes that have each been customized.

They share the same hosting account .

If anyone is wondering how this happened, site A is my name and was the first site I started blogging on. As the blog began to grow, I bought B, a much better domain name that is more SEO-friendly to my niche. With most of my content on site A, however, I used B only to make resource pages and to explain more about who I am and what services I can offer - a resume of sorts.

It's now been rightly pointed out to me that Site B deserves to have most of the content, while Site A (my name) should be the simple site that explains what I am about.

It's an unfortunate situation that came up from a lack of foresight. But alas, here I am.

Is there any way to swap the domain names that I both own, solving the problem without resorting to a large-scale transfer of content one page at a time.

If you're running WordPress software on a hosting site you can administer, you can update the config file of your web server on each website to point to the correct path. For example, if you use Apache and your current config files are:

<VirtualHost *:80>
    ServerName www.site_a.com
    DocumentRoot "/www/site_a"
</VirtualHost>

<VirtualHost *:80>
    ServerName www.site_b.com
    DocumentRoot "/www/site_b"
</VirtualHost>

Then update it to:

<VirtualHost *:80>
    ServerName www.site_a.com
    DocumentRoot "/www/site_b"
</VirtualHost>

<VirtualHost *:80>
    ServerName www.site_b.com
    DocumentRoot "/www/site_a"
</VirtualHost>

Alternatively, if you're hosting on WordPress site (eg site_a.wordpress.com), then your simplest option will perhaps be downloading a backup of each site, and restore them switched.

You should contact your website hosting provider and ask for help. They can help you by swapping document root of both sites (by assuming both website hosting at same provider).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM