Forum

Thread tagged as: Question

Multiple different websites under one perch license.

Hi,

I have been working on multiple websites (with different landing page, but same sub-page templates). I have got a request from my client to have a single database for all the websites.

What they expect is; if they populate the content for each of the sub-pages once, it can be re-used for sub-pages in all the remaining (child) sites.

Please help me on this, & let me know if it is even possible.

Damian McCracken

Damian McCracken 0 points

  • 4 years ago

You will need a license for each domain running Perch.

You can share content between installs, I have done it. There is some info here:

https://forum.grabaperch.com/forum/09-29-2015-sharing-content-between-perch-installs

Hi Mike,

Thanks for the reference, I implemented the same, & it worked for me but had raised a drop point, the 2 sites have different landing pages & if I change the content for one site it change the landing page content for the other site's landing page. Could you please help me get through it.

I'm sharing my config file code below:

<?php

$current_page_URL = $_SERVER["localhost"] . $_SERVER["localhost:8024/news/"];

if ($current_page_URL == 'localhost:8024/news/') 
{
    define('PERCH_SITEPATH', '/content/news_page');
    define('PERCH_LICENSE_KEY', '1111111111111111111111111111111');
    define("PERCH_DB_USERNAME", 'db1');
    define("PERCH_DB_PASSWORD", '000000000');
    define("PERCH_DB_SERVER", "localhost");
    define("PERCH_DB_DATABASE", "db1");
    define("PERCH_DB_PREFIX", "perch2_");
    define('PERCH_TZ', 'UTC');
    define('PERCH_EMAIL_FROM', 'xyz@xyz.com');
    define('PERCH_EMAIL_FROM_NAME', 'xyz');
    define('PERCH_LOGINPATH', '/perch');
    define('PERCH_PATH', str_replace(DIRECTORY_SEPARATOR.'config', '', __DIR__));
    define('PERCH_CORE', PERCH_PATH.DIRECTORY_SEPARATOR.'core');
    define('PERCH_RESFILEPATH', PERCH_PATH . DIRECTORY_SEPARATOR . 'resources');
    define('PERCH_RESPATH', PERCH_LOGINPATH . '/resources');
    define('PERCH_HTML5', true);
}   
else {
     define('PERCH_SITEPATH', '/content/news_page');
     define('PERCH_LICENSE_KEY', '0000000000000000000000000');
    define("PERCH_DB_USERNAME", 'db2');
    define("PERCH_DB_PASSWORD", '000000000');
    define("PERCH_DB_SERVER", "localhost");
    define("PERCH_DB_DATABASE", "db2");
    define("PERCH_DB_PREFIX", "perch2_");
    define('PERCH_TZ', 'UTC');
    define('PERCH_EMAIL_FROM', 'xyz@xyz.com');
    define('PERCH_EMAIL_FROM_NAME', 'xyz');
    define('PERCH_LOGINPATH', '/perch');
    define('PERCH_PATH', str_replace(DIRECTORY_SEPARATOR.'config', '', __DIR__));
    define('PERCH_CORE', PERCH_PATH.DIRECTORY_SEPARATOR.'core');
    define('PERCH_RESFILEPATH', PERCH_PATH . DIRECTORY_SEPARATOR . 'resources');
    define('PERCH_RESPATH', PERCH_LOGINPATH . '/resources');    
    define('PERCH_HTML5', true);
}

Thanks in advance.