• Hi,
    let’s say my customer has site customer.com and old website is located in another server, and he would like to start building new site with our Multisite WP installation.

    I’m adding new site+user to WP multisite as customer.com, OK , but can i somehow add subdomain like newsite.customer.com pointing to same domain, so that customer can test it, and when page is done, i just make DNS change ?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator bcworkz

    (@bcworkz)

    You need appropriate DNS and virtual host entries to get subdomain requests to the WP installation. But how is customer.com getting to your WP installation if its DNS still leads to the original site? It doesn’t.

    You need a temporary staging sub domain + normal domain name configured to lead to your WP site. When it comes time to launch the new site, alter the customer.com DNS and search the DB tables for the staging domain and replace with customer.com. The Better Search and Replace plugin is handy for this.

    Thread Starter khedman

    (@khedman)

    Yes i have DNS pointing newsite.customer.com to multisite server and i have newsite.customer.com in apache virtualhost ServerAlias and they all DocumentRoot points to the Multisite root directory. But when i go to https://newsite.customer.com , it just goes to servers root “server1.hosting.com”

    This system is working ok with plain TLD domains but not with subdomains when Multisite user/domain is not that same subdomain but an real TLD.

    So user can login as a user i create (e.g. customer.com) via servers realname server1.hosting.com/wp-login.php , but there is not any way to show this users new webpage thru Multisite install ? Like newsite.customer.com or server1.hosting.com/customer.com when DNS is still pointing to some old server ? Real domain TLD allways have to point to Multisite server ?

    Also in Multisite i cannot install any “Search and Replace plugins”, because they will be available for all normal Admin’s also, and they can then search & replace any users mysql tables, because it’s Multisite install.

    I don’t think im alone with this, domains have been and will be moved to new servers with minimal downtime, Multisite install doesn’t give you that without making some database changes.

    With single WP install this is not any problem.

    Moderator bcworkz

    (@bcworkz)

    If the real registered domain is pointing to a different server and you want to get a subdomain request to go to different URL temporarily leading to your multisite, you need an .htaccess rule doing so on the server of the registered domain. The address in the browser will update accordingly.

    For example, oldsite.com leads to the old site. newsite.com leads to your multisite. staging.newsite.com leads to your client’s sub-site in your multisite. You could have staging.oldsite.com be rewritten to staging.newsite.com with a rule on oldsite.com. The client can type in staging.oldsite.com, but when their staging site loads its address in the browser will change to staging.newsite.com.

    It sounds like you have a VPS hosting account? Unless the account allows for wildcard subdomains, I think you still need to add the subdomain to your hosting account so it can be added to the physical server’s hosts file. You did add the user’s site to the WP Sites admin screen, right? Just checking ?? If you continue to have trouble getting subdomain requests to your VPS you likely need assistance from your host to get it working.

    The search and replace plugin is used for a short time to update a relocated DB. As soon as that is done you should remove the plugin. The plugin is based on the interconnect/it script. You could use that script instead. It is installed outside of WP, but on the same server. This means the script and its folder can be protected by Basic Auth or similar .htaccess directives. Make no mistake, it’s presence is still a security risk. The script should be removed when you are finished with it.

    Thread Starter khedman

    (@khedman)

    I have my own physical servers, which are running VPS’s + control panels as DNS servers, webservers etc. , so i know and can do whatever needed.

    Problem is if i add somesite.com to WP Multisite , and then added somesite.com and serveralias xzczzx.somesite.com to apache virtualhost pointing to somesite.com which has WP Multisite webroot and also xzczzx.somesite.com DNS pointing to same server. Still there is no way i can see that xzczzx.somesite.com as i can see somesite.com, WP multisite just doesn’t undertand that.. With single WP install not any problems.

    Thanks for DB script tip !

    Still figuring out how to move root domains easily to WP Multisite when old sites is still running in some other server. WP single can do but stupid to run multiple databases for e.g. simple landing pages.

    • This reply was modified 4 years, 6 months ago by khedman.
    Moderator bcworkz

    (@bcworkz)

    OK, you know more about server admin than I do then.

    I’ve not tried migrating a single WP installation into multisite. If there are more than a few sites involved then multisite does make sense.

    You don’t have to have multiple DBs to run multiple single installations, only unique table prefixes. You end up with a lot of tables, but the same goes with multisite. The biggest waste is all the redundant PHP files.

    One of the import plugins might be able to pull a single site export into multisite. I’ve not had complete success with those plugins even with single to single though. I suppose manually fiddling with the SQL export file’s table names to allow it to be imported into a new multisite subsite’s tables would work without needing a plugin. Can’t say I ever tried it though.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Adding subdomain to real “offline” domain’ is closed to new replies.