FORUMS CLOSED DUE TO SPAM. YOU STILL CAN ADD POST!

Sub Domain Site

Feed 1 posts, 2 voices

Avatar
1 posts

Hi all!

Is there such a functionallity in Frog, so I could create subsites on subdomains for one main site.

I tried to search the forum but couldn’t find anything.

Ex. If my main site is site.com, I would like to be able to create unlimited subsites like

sub1.site.com, sub2.site.com…, subn.site.com

Can I do with Frog?

Thanks!

 
Avatar
180 posts

You can use $_SERVER[“HTTP_HOST”].

… in config.php

// Database settings:
switch ($_SERVER["HTTP_HOST"])
{
   case 'sub1.site.com': // Use different databases (or TABLE_PREFIX)
      define('DB_DSN', 'mysql:dbname=sub1_site_com;host=localhost;port=3306');
      define('DB_USER', 'root');
      define('DB_PASS', '');
      define('TABLE_PREFIX', 'frog_');
      break;
   case 'sub2.site.com': // Database or settings for sub2.site.com
      define('DB_DSN', 'mysql:dbname=sub2_site_com;host=localhost;port=3306');
      define('DB_USER', 'root');
      define('DB_PASS', '');
      define('TABLE_PREFIX', 'frog_');
      break;
}

All your subsites *.site.com should look at site.com.

I think this will be helpfull tip.