WordPress multisite with different domain on single installation

After installation of core wordpress if you want to setup wordpress multisite on same  installation then do as follow.

/* Multisite */
define('t2vhyu85e1_ALLOW_MULTISITE', true);

Wordpress will ask you setup multisite of two type…

  • Sub – Domain
  • Sub Dir

Select Sub-Domain type as it required for setup different domain. After wordpress network setup correctly logout and login back.

Add different domain on single wordpress code.

  1. Go to the My Site -> Network Admin -> Sites -> Add new
  2. It will ask you Site Address, Site Tittle and Admin Email. e.g. Lets say if you want to add www.newsite.com from www.ask4solution.org, then put site name as “newsite” and Add site.
  3.  After site added successfully you will get edit site form, where you can see site name like – “newsite.ask4solution.org”.
  4. Now we have to change site name and home url like  www.newsite.com and http://www.newsite.com/ respectively
  5. That’s All!

DNS settings

Now one thing we have to do related with domain name, we need to point www.newsite.com to www.ask4solution.org of document root. WordPress will serve www.newsite.com on the same installation.

 

 WP-CONFIG setting

We need to set cookie domain

if(stristr($_SERVER['HTTP_HOST'],
'newsite.com'))
{
define('COOKIE_DOMAIN','.newsite.com');
}
else{
define('COOKIE_DOMAIN',
'.ask4solution.org');
}

Categories: Wordpress