PHP code example of gwa / multisite-directory-resolver

1. Go to this page and download the library: Download gwa/multisite-directory-resolver library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

gwa / multisite-directory-resolver example snippets


// project root: path/to/project
// wp install:   path/to/project/custom/install/path

// choose which resolver you like to use
// 1. MultisiteResolverManager::TYPE_FOLDER - Use only for sub folder url handling -> example.com/site1/../..
// 2. MultisiteResolverManager::TYPE_SUBDOMAIN - Use only for sub domain handling -> test.example.com

$mdr = new Gwa\Wordpress\MultisiteDirectoryResolver('custom/install/path', $resolver);
$mdr->init();

define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST']);
define('ADMIN_COOKIE_PATH', '/');