• Greetings,

    I am new here and have a I think a simple question.
    For a friend of mine I made a WP page with a BeTheme.
    He had a bad Hosting for his old .com Webspace so he bought another one for a .net Webspace. On his old .com URL he still has his old site, and the Namespace Servers on the old dns are pointing still to the old site (plain old html site that will be deleted and not important).

    I asked the new Hosting guys to prepare their Namespace Servers with the .com entry. I have an up and running site on the .net Domain (also the links and Pictures in WP database are linked with the .net Domain). I would like to use the .com Domain. The new Hosting guys told me just to Change the A Host DNS record to Point to their IP and the Domain will be then active on the new Hosting with .com and both .net.

    My question is , can this work, or I Need to Change something on WP side? I would like to use the .com Domain as Primary and .net only as backup not so impoortant as .com.
    I think that I would have a Problem if I Change not the Namespace records for the https://www.somesite.com to Point to the new Hosting where I have https://www.somesite.net

    What are your suggestions? I hope that I did not make this complicated, but this is a Transfer Phase.
    Kind regards.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello @ultimo2016!

    The short answer to your question is no. But you just have to make a small alteration in the WordPress installation in order for it to work.

    Access your server via SFTP or FTP, or a file manager in your hosting account’s control panel, navigate to the root folder of your WordPress installation and look for a file named wp-config.php.

    Now open the file and place below lines after the table_prefix line; order is very important in wp-config.php.

    /*
     * Handle multi domain into single instance of wordpress installation
     */
    define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST']);
    define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST']);

    Go to WordPress admin page and take a look at Settings -> General. You will have WordPress Address (URL) and Site Address (URL) will be in disabled state. It means your WordPress installation dynamic enough to accommodate both domain address.

    That’s it, now the WordPress instance has been enabled with multiple domain address!

    Thread Starter ultimo2016

    (@ultimo2016)

    Hey Dinisbcoelho,

    Thanks for the reply.

    I did as you told me. I added the lines in the wp-config, and the settings under General are dimmed now and cannot be changed, which is ok, it means that the code worked.

    Then I went to my DNS Hosting settings on my secondary Domain server, and made the A Host record pointing to the new hosting (the new hosting company told me that they also made an DNS entry for my old domain https://www.somesite.com to be associated with their DNS IP). Although I did that, on the mxtoolbox I could not not see a live DNS check, and it did not worked. My suspicions are maybe the new hosting company did not made an DNS entry on their servers, or this multisite is not working as I thought it would.

    Another question also there, what about the links in the site. If a link in WP https://www.somesite.net/somepicture.jpg are pointing to .net , what will happen if a visitor comes to visit the site from https://www.somesite.com , because I would like them mostly to visit somesite.com (the old one). Or will WP automatically change the links according to the http requests?

    Is there a log in WordPress that can track and show who tried to access which site, either .com or .net , or do I have to turn on debugging mode?

    Kind regards.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Two domains – transfer – links – howto?’ is closed to new replies.