• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Multiple domains and sites, ONE CMSMS!
PostPosted: Sat Jun 14, 2008 6:40 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Thu Jan 26, 2006 11:46 am
Posts: 700
Multiple Domains and Sites under ONE CMS Made Simple Installation.

(this is a working draft / work in progress / handle with care)

These instructions (this original post) requires mod_rewrite and Apache web server (Linux); pretty URLs enabled in CMSMS with hierarchy on. HOWEVER MOD_REWRITE IS NOT REQUIRED (see replies to this post).

Requires multiple domains pointing to the same web space (e.g. on cPanel 11 hosts, the additional domains are "Parked Domains"). That web space is assumed to be the root web space for all domains or subdomains being used; use of CMSMS in subdirectories will require some tweaking on your part...

Test environment: Apache 1.3.xx and PHP 5.1.xx running CMS Made Simple 1.3 on Linux 2.6.xx

Here's what I did, in roughly the same order... (Note: as I was writing this, I was changing domains and such on the fly so this could be as 'generic' as possible...)


0. Created a new hosting account (cPanel 11 based server; one of mine) for domain1.com; parked domain2.net and domain3.org (without any redirects) on same account. Web space now answers to three different domains all via http://www.domain.tld/

Note that the domains had previously been configured to point to that server, name servers changed, etc. Registering domains, setting up their name servers, and setting up the account and the domains at a host are all beyond the scope of this little howto.


1. Install CMSMS 1.3 in root of domain1.com and test. For simplicity in editing/adding test content, I did not install the 'sample content'.


2. Clear CMSMS cache via admin panel.


3. Enable Pretty URLs...

Modify config.php as follows:

Code:
$config['assume_mod_rewrite'] = true;
$config['page_extension'] = '/';
$config['use_hierarchy'] = true;


While I was in there, I also made the following change to the root_url:

Code:
$config['root_url'] = 'http://' . $_SERVER['HTTP_HOST'];


Copy htaccess from ./doc to ./ and rename as .htaccess; modify as follows (complete file shown, except server-specific stuff, such as enabling php5, error doc names, etc):

Code:
# BEGIN CMSMS and Rewrite Rules
RewriteEngine On

# Might be needed esp in a subdirectory
#RewriteBase /

# URL Filtering helps stop some hack attempts
#IF the URI contains a "http:"
RewriteCond %{QUERY_STRING} http\: [OR]
#OR if the URI contains a "["
RewriteCond %{QUERY_STRING} \[ [OR]
#OR if the URI contains a "]"
RewriteCond %{QUERY_STRING} \] [OR]
#OR if the URI contains a "<script>"
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
#OR script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
#OR any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule ^.*$ - [F,L]

# CMSMS Rewriting
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]

# second domain and page alias for its domain root
RewriteCond %{HTTP_HOST} domain2\.net [NC]
RewriteCond %{REQUEST_URI} ^/$
RewriteRule .* /domain2site

# third domain and page alias for its domain root
RewriteCond %{HTTP_HOST} domain3\.org [NC]
RewriteCond %{REQUEST_URI} ^/$
RewriteRule .* /domain3site

# END CMSMS

# END Rewrite rules


The last two parts were added, using the page aliases we'll be using a little later on when we set up content in the back-end for the "other" two domains. These will be the aliases of the "other" domains' "root" or "home" pages.


4. In the back-end, since we did not install the sample content, we've only got a single page, "Home" which will also be the "home page" or domain root for the "first" domain. Modify that so the alias is short but descriptive for the domain. For this howto, we'll just use "one" for the alias of the homepage for domain1.com

Make a new page, call it and alias it whatever you want, but make "one" the parent of it.

Test the front-end; pretty URLs should be working.


5. Add another new page, alias it what we entered in .htaccess as the page alias for the domain root of the second domain. For this example, we're using "domain2site".


6. Add yet another new page, alias it whatever you want and make "domain2site" its parent page.

At this point, we've got domain1's pages as elements 1 and 1.1, and domain2's pages as elements 2 and 2.1

Now open a new browser window or tab and go striaght to http://www.domain2.tld/ to test. Also check out its child page.


7. Repeat 5 & 6 for the third domain.

ALL DONE. LOOK MA! THREE DOMAINS, ONE CMSMS! All that's left is a little housekeeping...


8. Clean up the menus...

You'll notice in the menus that the "home" of each additional domain has its page alias appended to it. A little messy, but easy to fix. We'll be using a copy of the minimal_menu.tpl here, named MultiSiteMenu, modified as follows (entire changed template shown). See the Smarty comments for what will require a quick edit:

Code:
{if $count > 0}
<ul class="clearfix">
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string="<ul>" times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}
{repeat string="</li></ul>" times=$node->prevdepth-$node->depth}
</li>
{elseif $node->index > 0}</li>
{/if}

{* below line should be checking for the aliases of the 'home' pages of the additional domains *}
{if $node->alias eq 'domain2site' or $node->alias eq 'domain3site'}{assign var=utmp value="$root_url/"}
{else}{assign var=utmp value=$node->url}{/if}
{* $utmp replaces $node->url in the menu items below *}

{if $node->current == true}
<li><a href="{$utmp}" class="currentpage"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext} </a>

{elseif $node->parent == true && $node->depth == 1}
<li class="activeparent"> <a href="{$utmp}" class="activeparent"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext} </a>

{elseif $node->type == 'sectionheader'}
<li class="sectionheader">{$node->menutext}

{elseif $node->type == 'separator'}
<li style="list-style-type: none;"> <hr class="separator" />

{else}
<li><a href="{$utmp}"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext} </a>

{/if}

{/foreach}

{repeat string="</li></ul>" times=$node->depth-1}</li>
</ul>
{/if}



Then modify the menu call in your site template, so it looks something like this:

Code:
{cms_module module='menumanager' template='MultiSiteMenu'}



9. Clean up and customize the template, CSS and menu items for each "site"...

The entire site template is shown, read the Smarty comments to see what was added and why... (Note: I used a fresh, simple template for this testing, not the default one).


Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

{* some initial setup *}
{* strip www. dots and dashes from server host name and assign to a variable for later use *}
{assign var=stmp value=$smarty.server.SERVER_NAME|replace:'www.':''|replace:'.':''|replace:'-':''}
{if $stmp eq 'domain2net'}
   {assign var=ntmp value='This is Domain 2'}{* ntmp is this domains site title *}
   {assign var=mtmp value='2'}{* mtmp is starting element for this domains menu *}
{elseif $stmp eq 'domain3org'}
   {assign var=ntmp value='This is Domain 3'}
   {assign var=mtmp value='3'}
{else}
   {assign var=ntmp value='This is Domain 1'}
   {assign var=mtmp value='1'}
{/if}
{* end setup *}

<head>

{* ntmp is our site title from above *}
<title>{title} | {$ntmp}</title>

{stylesheet}

{* stmp is our mashed up hostname, used to deliver custom stylesheet for each site, named as masheduphostname-styles *}
{* these stylesheets should NOT be associated with the template! *}
{stylesheet name="$stmp-styles"}

{metadata}

</head>

<body>

<div id="wrap">

<div id="header">

{* ntmp is our site title from above *}
<h1>{$ntmp}</h1>

</div><!-- /header -->

<div id="main" class="clearfix">

<div id="side">
<div id="sidemenu">
<h2>Site Menu</h2>

{* mtmp is our starting spot for our menu, only it and its children are shown *}
{cms_module module='menumanager' template='MultiSiteMenu' start_element="$mtmp"}

</div><!-- /sidemenu -->
</div><!-- /side -->
         
<div id="content">

<h1>{title}</h1>
{content}

</div><!-- /content -->

</div><!-- /main -->

<div id="footer">
{global_content name='footer'}
</div><!-- /footer -->

</div><!-- /wrap -->

</body>
</html>


Note that in this example; I used a single template for all three "sites". Not absolutely necessary but it sped up the testing a bit by keeping everything in one place.

So far this has been just a 'proof of concept' / 'can it be done' experiment..  test before implementation; use at own risk; YMMV; Windows hosts need not apply; etc; etc; etc...

EOF 14JUN08/1220CST DRAFT1  (edit1: some clarifications at the beginning)

(attachment is text file containing this post)


Attachments:
cmsmsmultisite-draft.txt [8.48 KiB]
Downloaded 341 times

_________________
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info


Last edited by kermit on Sat Jul 05, 2008 8:25 pm, edited 1 time in total.
Top
 Profile  
 
 Post subject: Re: Multiple domains and sites, ONE CMSMS!
PostPosted: Sat Jun 14, 2008 6:49 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Fri Feb 02, 2007 4:31 pm
Posts: 2396
Location: Comox Valley, BC
Excellent - can't wait to try it.

Nullig

_________________
Come play in the Sandbox at my CMS Made Simple demo site: http://www.cmsmsdemo.com.


Top
 Profile  
 
 Post subject: Re: Multiple domains and sites, ONE CMSMS!
PostPosted: Sat Jun 14, 2008 9:02 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Thu Jan 26, 2006 11:46 am
Posts: 700
to also remove each site's parent alias from the URLs of their children, instead of just the domain roots themselves, so you get...

www.domain2.net/first-level/second-level/

instead of...

www.domain2.net/domain2site/first-level/second-level/

try replacing (in the menu template)...

Code:
{* below line should be checking for the aliases of the 'home' pages of the additional domains *}
{if $node->alias eq 'domain2site' or $node->alias eq 'domain3site'}{assign var=utmp value="$root_url/"}
{else}{assign var=utmp value=$node->url}{/if}


with something like this (using aliases from the original example)...

Code:
{* remove each site's root page alias from their respective 'home pages' and children *}
{assign var=utmp value=$node->url|replace:'/one/':'/'|replace:'/domain2site/':'/'|replace:'/domain3site/':'/'}


or you could use a single regex_replace modifier that does the same thing, if you were so inclined...

_________________
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info


Top
 Profile  
 
 Post subject: Re: Multiple domains and sites, ONE CMSMS!
PostPosted: Sun Jun 15, 2008 6:19 am 
Offline
Power Poster
Power Poster
User avatar

Joined: Thu Jan 26, 2006 11:46 am
Posts: 700
you can do this even without mod_rewrite and pretty url's (with just the modified root_url in config.php) so long as you can redirect the 'other' domain roots to their "home page" inside cmsms (perhaps with 301 redirects) and include a little smarty logic in your templates or menus, if necessary, to separate each site's pages and menus.


update: this method is working great on one set of sites i'm working on... although i have skipped the 301 redirects on the 'other' domains' roots to their respective inside pages. instead i've worked both the template and the 'default' page in cmsms to show different content based upon what domain was hit.

EDIT 1.. update.

_________________
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info


Last edited by kermit on Mon Jun 30, 2008 2:44 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Multiple domains and sites, ONE CMSMS!
PostPosted: Sun Jun 15, 2008 7:19 am 
Offline
Power Poster
Power Poster
User avatar

Joined: Mon Jun 25, 2007 5:36 pm
Posts: 1067
Location: Portugal
Okay, i have to say that, i have a multisites system run since Dez 2007, now widt this last fantastic version a ONLY change 3 files and VOILA!

So..., i have multi-domains point to the same install, all is separatly config, temp, uploads, db etc, etc...

If all the modules are not in hardcode everything works well, but sometimes the modules are set up wrong,

E.G.
include("config.php"); instead include("include.php") put the config strings of uploads and temp instead  manually etc, etc.

Maybe I'll talk to the calguy1000 guru ;) to put the Best Practices in docs or somewhere


---EDIT---
BTW: files changes:
fileloc.php, config.php and admin/sitepref.php (to clean the cache)

SINCE 1.4 just fileloc and 1 new config-string so, WOW

Best Regards and good luky


Last edited by nuno on Fri Jun 27, 2008 2:52 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Multiple domains and sites, ONE CMSMS!
PostPosted: Mon Jun 16, 2008 3:20 am 
Offline
Power Poster
Power Poster
User avatar

Joined: Wed Jan 02, 2008 11:39 pm
Posts: 2154
Location: Lewiston-Idaho
Hey glad to see the realization of something that was swimming in my head... I like what I see it is working into.... 

This is why I’m so happy to have found CMSms, a community that works together :) have a great one...
jeremyBass

_________________
Sorry. Too little support in projects, too little reason to not deprioritize. May-be if more attention is needed.
Follow me on Twitter | Follow me on FaceBook


Top
 Profile  
 
 Post subject: Re: Multiple domains and sites, ONE CMSMS!
PostPosted: Mon Jun 16, 2008 9:40 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Wed Jan 02, 2008 11:39 pm
Posts: 2154
Location: Lewiston-Idaho
Hey, there.... I was rereading this and thought that this may need to change

Quote:
Note that the domains had previously been configured to point to that server, name servers changed, etc. Registering domains, setting up their name servers, and setting up the account and the domains at a host are all beyond the scope of this little how-to.


to include that the domains need to be aliased to root of the cms install to respect the "index.php?page=$1"
It does not seem clear on that fact... though if one was to read the posted stuff from before it'd be clear.... Just a thought...

plus IMHO the use of text also plays more of an important roll...
same with using relative links... ie: uploads/someFolder/someImg.jpg (so one can share parts between sites...)


:) just some thoughts....

jeremyBass

_________________
Sorry. Too little support in projects, too little reason to not deprioritize. May-be if more attention is needed.
Follow me on Twitter | Follow me on FaceBook


Top
 Profile  
 
 Post subject: Re: Multiple domains and sites, ONE CMSMS!
PostPosted: Sat Jul 05, 2008 8:25 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Thu Jan 26, 2006 11:46 am
Posts: 700
Some notes about a real-world implementation of my "no hack" Multisite mod:

Running Apache on Linux, pretty URLs enabled, but not hierarchy.

Six domains and six separate, but related, sites managed from a single CMSMS 1.3.x installation, and administered by one or two people.

First set up one domain on hosting account, and then added the others as "parked" or "addon" domains to the first. All six domains point to the very same directory; and the server answers as all six, depending upon which one was in the request headers.

ONLY using the config.php mod, no special rewrite rules or redirects.

Using same main template for all sites and pages. Sites all had the same or similar layout before redevelopment with CMSMS, so we just stuck with the same thing; except we did rewrite the html and css from scratch (to clean things up) to achieve the same overall look. Logos, colors, etc. are loaded by specific stylesheets (see below).

Setting up a few Smarty variables above in the template, based upon {$smarty.server.SERVER_NAME}, things like:

* {$ntmp} - actual site name, replaces {sitename}. Used in the , <meta> description, and here-n-there on a few pages.<br /> * {$mtmp} - start element of each site's menu (using friendly position). Used for menu call. Didn't need to be separated from menu call, but makes it convenient having all the "config" in one spot.<br /> * {$stmp} - a shortened version of the domain name, stripping dots and 'www' out (e.g. leaving 'site1com', etc). Just makes it a little more convenient than using $smarty.server.SERVER_NAME} everywhere. Used for various IF statements in template and a few pages, and also as part of site-specific stylesheet names, as well as image names and/or dirs in places.<br /> * {$ntmp} - default news categories for the site (as would be entered in a news tag). Used on "news" page and in template.<br /> * and a couple others, but those aren't relevant to these notes...<br /><br />CMSMS "default" page is used by all "sites", and has customized output for each, based upon {$stmp}. This page won't change often and has data pulled from news (using {$ntmp} categories), so it still stays relatively "fresh" provided that news gets added every now-and-then..  something like {global_content name="frontpage-$stmp"} would work here as well... so you could edit each site's "home page" content separately.<br /><br />Template's menu call uses {$mtmp} to tell MenuManager where each site's menu starts in the overall scheme of things. Each site's menu only shows its own items. Each site's menu starts with a section heading for clarity in the back-end, while {$mtmp} refers to the first child underneath the section headings.<br /><br />The main template has a screen and print media stylesheet associated with it; the screen one includes the basics (layout, default colors, etc); and an extra, site-specific one (that is not associated with the template) is loaded using something like {stylesheet name="$stmp-screen"} .. on this actual site, though, we're using three separate {static_stylesheet} tags, one for each stylesheet, referenced by name, and in the order we want them in, instead of automatically linking to the stylesheets associated with a template by using a 'bare' tag.<br /><br />A few pages are shared (such as contact.html, news.html, etc), for those we customize output a bit (again, using the vars above and a couple Smarty IFs). The additional sites using a page have Internal Links to the original (which are listed with the pages of the first, or 'main' site).<br /><br />There are a couple pages, not shown in menus, that are outside the above menu structure, and just sit at the bottom of the Pages list in the back end. These are linked directly from content or header/footer links, and don't appear in the main site menu.<br /><br />My Full Page Caching mod is also implemented, and there have been absolutely no issues with it and the Multisite setup. The only other "speed tweak" used is {static_stylesheet} tag...<br /><br />Overall everything is working just great; the added benefit of having one database and one CMSMS install to back up is a huge plus.<br /><br />Between the only having 'one' CMSMS install, and eliminating what duplication of 'uploads' files that there was between the sites, the Multisite mod has knocked over 60mb off the storage requirements for the combined sites, and a sizable chunk off every full backup made...  and the Full Page Caching mod has dropped server load to almost nothing (over 90% of page views are at least server-cached), while reducing bandwidth requirements between 30-40% due to browser-caching option.</div> <div class="postbody"><br />_________________<br />eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.<br />4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's <span style="text-decoration: underline">net</span> profit (USD) for the quarter (3 months) ending 31 March 2007. <br /><strong>CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info </strong></div> <br /><br /> <span class="gensmall">Last edited by <a href="./memberlist.php?mode=viewprofile&u=1249">kermit</a> on Sat Jul 05, 2008 8:27 pm, edited 1 time in total.</span> <br clear="all" /><br /> <table width="100%" cellspacing="0"> <tr valign="middle"> <td class="gensmall" align="right"> </td> </tr> </table> </td> </tr> </table> </td> </tr> <tr class="row2"> <td class="profile"><strong><a href="#wrapheader">Top</a></strong></td> <td><div class="gensmall" style="float: left;"> <a href="./memberlist.php?mode=viewprofile&u=1249"><img src="./styles/subsilver2/imageset/en/icon_user_profile.gif" alt="Profile" title="Profile" /></a>  </div> <div class="gensmall" style="float: right;"> </div></td> </tr> <tr> <td class="spacer" colspan="2" height="1"><img src="images/spacer.gif" alt="" width="1" height="1" /></td> </tr> </table> <table class="tablebg" width="100%" cellspacing="1"> <tr class="row1"> <td align="center" valign="middle"> <a name="p125657"></a> <b class="postauthor">purplerain12</b> </td> <td width="100%" height="25"> <table width="100%" cellspacing="0"> <tr> <td class="gensmall" width="100%"><div style="float: left;"> <b>Post subject:</b> Re: Multiple domains and sites, ONE CMSMS!</div><div style="float: right;"><a href="./viewtopic.php?p=125657#p125657"><img src="./styles/subsilver2/imageset/icon_post_target.gif" width="12" height="9" alt="Post" title="Post" /></a><b>Posted:</b> Fri Sep 19, 2008 7:06 am </div></td> </tr> </table> </td> </tr> <tr class="row1"> <td valign="top" class="profile"> <table cellspacing="4" align="center" width="150"> <tr> <td><img src="./styles/subsilver2/imageset/en/icon_user_offline.gif" alt="Offline" title="Offline" /></td> </tr> <tr> <td class="postdetails">Forum Members</td> </tr> <tr> <td><img src="./images/ranks/star.gif" alt="Forum Members" title="Forum Members" /></td> </tr> </table> <span class="postdetails"> <br /><b>Joined:</b> Thu Aug 14, 2008 10:33 am<br /><b>Posts:</b> 110<br /><b>Location:</b> Nederland </span> </td> <td valign="top"> <table width="100%" cellspacing="5"> <tr> <td> <div class="postbody">Hello,<br /><br />Is multiple domains en websites in one cmsms ONLY possible on a Linux server???<br /><br />Bas</div> <br clear="all" /><br /> <table width="100%" cellspacing="0"> <tr valign="middle"> <td class="gensmall" align="right"> </td> </tr> </table> </td> </tr> </table> </td> </tr> <tr class="row1"> <td class="profile"><strong><a href="#wrapheader">Top</a></strong></td> <td><div class="gensmall" style="float: left;"> <a href="./memberlist.php?mode=viewprofile&u=13692"><img src="./styles/subsilver2/imageset/en/icon_user_profile.gif" alt="Profile" title="Profile" /></a>  </div> <div class="gensmall" style="float: right;"> </div></td> </tr> <tr> <td class="spacer" colspan="2" height="1"><img src="images/spacer.gif" alt="" width="1" height="1" /></td> </tr> </table> <table class="tablebg" width="100%" cellspacing="1"> <tr class="row2"> <td align="center" valign="middle"> <a name="p205358"></a> <b class="postauthor">Augustas</b> </td> <td width="100%" height="25"> <table width="100%" cellspacing="0"> <tr> <td class="gensmall" width="100%"><div style="float: left;"> <b>Post subject:</b> Re: Multiple domains and sites, ONE CMSMS!</div><div style="float: right;"><a href="./viewtopic.php?p=205358#p205358"><img src="./styles/subsilver2/imageset/icon_post_target.gif" width="12" height="9" alt="Post" title="Post" /></a><b>Posted:</b> Fri Apr 16, 2010 12:54 pm </div></td> </tr> </table> </td> </tr> <tr class="row2"> <td valign="top" class="profile"> <table cellspacing="4" align="center" width="150"> <tr> <td><img src="./styles/subsilver2/imageset/en/icon_user_offline.gif" alt="Offline" title="Offline" /></td> </tr> <tr> <td class="postdetails">Forum Members</td> </tr> <tr> <td><img src="./images/ranks/star.gif" alt="Forum Members" title="Forum Members" /></td> </tr> <tr> <td><img src="./download/file.php?avatar=8885.png" width="80" height="53" alt="User avatar" /></td> </tr> </table> <span class="postdetails"> <br /><b>Joined:</b> Wed Oct 17, 2007 6:09 pm<br /><b>Posts:</b> 227<br /><b>Location:</b> the world </span> </td> <td valign="top"> <table width="100%" cellspacing="5"> <tr> <td> <div class="postbody">Great idea for the multi-domain website! Thank you!<br />I am using this mod for several of website I maintain. <br />Most of them are targeted to different countries, therefore I have different domain names (.com, .co.uk, .ca, etc.) - but the database with design/templates is shared among them and the editor can just login once and edit everything.<br />Excellent! <img src="./images/smilies/wink.gif" alt=";)" title="Wink" /><br /><br />Actually, I noticed during the upgrade of new versions of CMSMS, the config.php file is changed, and the line:  <br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">$config['root_url'] = 'http://' . $_SERVER['HTTP_HOST'];</div><br /><br />is changed back to the default:<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">$config['root_url'] = 'http://www.domain.com';</div><br /><br />So, everytime you upgrade CMSMS, do not forget to modify again the <strong>'root_url'</strong> parameter in the config.php</div> <div class="postbody"><br />_________________<br /><!-- m --><a class="postlink" href="http://FollowTheRoad.com/">http://FollowTheRoad.com/</a><!-- m --> - living on the road...<br /><!-- m --><a class="postlink" href="http://www.kligys.com/">http://www.kligys.com/</a><!-- m --> - asmeninis blog'as...</div> <br clear="all" /><br /> <table width="100%" cellspacing="0"> <tr valign="middle"> <td class="gensmall" align="right"> </td> </tr> </table> </td> </tr> </table> </td> </tr> <tr class="row2"> <td class="profile"><strong><a href="#wrapheader">Top</a></strong></td> <td><div class="gensmall" style="float: left;"> <a href="./memberlist.php?mode=viewprofile&u=8885"><img src="./styles/subsilver2/imageset/en/icon_user_profile.gif" alt="Profile" title="Profile" /></a>  </div> <div class="gensmall" style="float: right;"> </div></td> </tr> <tr> <td class="spacer" colspan="2" height="1"><img src="images/spacer.gif" alt="" width="1" height="1" /></td> </tr> </table> <table class="tablebg" width="100%" cellspacing="1"> <tr class="row1"> <td align="center" valign="middle"> <a name="p207712"></a> <b class="postauthor">junkant</b> </td> <td width="100%" height="25"> <table width="100%" cellspacing="0"> <tr> <td class="gensmall" width="100%"><div style="float: left;"> <b>Post subject:</b> Re: Multiple domains and sites, ONE CMSMS!</div><div style="float: right;"><a href="./viewtopic.php?p=207712#p207712"><img src="./styles/subsilver2/imageset/icon_post_target.gif" width="12" height="9" alt="Post" title="Post" /></a><b>Posted:</b> Tue May 04, 2010 2:36 pm </div></td> </tr> </table> </td> </tr> <tr class="row1"> <td valign="top" class="profile"> <table cellspacing="4" align="center" width="150"> <tr> <td><img src="./styles/subsilver2/imageset/en/icon_user_offline.gif" alt="Offline" title="Offline" /></td> </tr> <tr> <td class="postdetails">New Member</td> </tr> </table> <span class="postdetails"> <br /><b>Joined:</b> Thu Mar 04, 2010 9:26 pm<br /><b>Posts:</b> 1 </span> </td> <td valign="top"> <table width="100%" cellspacing="5"> <tr> <td> <div class="postbody">Fantastic solution, it works great.<br />I do have one question, how would it be possible to setup a search box that would search certain sites only?<br />For example, a search box on site1.com, searches only on that site and not every single site on the cms.<br />Currently I have a setup of about 20 sites and need help solving the search issue.<br />Thanks guys.</div> <br /><br /> <span class="gensmall">Last edited by <a href="./memberlist.php?mode=viewprofile&u=23694">junkant</a> on Thu May 06, 2010 6:37 pm, edited 1 time in total.</span> <br clear="all" /><br /> <table width="100%" cellspacing="0"> <tr valign="middle"> <td class="gensmall" align="right"> </td> </tr> </table> </td> </tr> </table> </td> </tr> <tr class="row1"> <td class="profile"><strong><a href="#wrapheader">Top</a></strong></td> <td><div class="gensmall" style="float: left;"> <a href="./memberlist.php?mode=viewprofile&u=23694"><img src="./styles/subsilver2/imageset/en/icon_user_profile.gif" alt="Profile" title="Profile" /></a>  </div> <div class="gensmall" style="float: right;"> </div></td> </tr> <tr> <td class="spacer" colspan="2" height="1"><img src="images/spacer.gif" alt="" width="1" height="1" /></td> </tr> </table> <table class="tablebg" width="100%" cellspacing="1"> <tr class="row2"> <td align="center" valign="middle"> <a name="p208980"></a> <b class="postauthor">milehigh</b> </td> <td width="100%" height="25"> <table width="100%" cellspacing="0"> <tr> <td class="gensmall" width="100%"><div style="float: left;"> <b>Post subject:</b> Re: Multiple domains and sites, ONE CMSMS!</div><div style="float: right;"><a href="./viewtopic.php?p=208980#p208980"><img src="./styles/subsilver2/imageset/icon_post_target.gif" width="12" height="9" alt="Post" title="Post" /></a><b>Posted:</b> Wed May 12, 2010 11:35 am </div></td> </tr> </table> </td> </tr> <tr class="row2"> <td valign="top" class="profile"> <table cellspacing="4" align="center" width="150"> <tr> <td><img src="./styles/subsilver2/imageset/en/icon_user_offline.gif" alt="Offline" title="Offline" /></td> </tr> <tr> <td class="postdetails">Forum Members</td> </tr> <tr> <td><img src="./images/ranks/star.gif" alt="Forum Members" title="Forum Members" /></td> </tr> </table> <span class="postdetails"> <br /><b>Joined:</b> Tue Jun 19, 2007 2:11 pm<br /><b>Posts:</b> 84 </span> </td> <td valign="top"> <table width="100%" cellspacing="5"> <tr> <td> <div class="postbody">Couple notes here on my implementation...below worked for me and gave me a nice clean <!-- w --><a class="postlink" href="http://www.domain.com/section.html">www.domain.com/section.html</a><!-- w --> output. I have Plesk installed on my VPS and the setup was as easy as creating a main domain and then having the other domains aliased under that one to get them to all answer to the same web space. In my case the series of websites all share the exact same template so it was a pretty easy implementation. (basically a bunch of brochure-ware types of sites).<br /><br />With only one navigation level the only real template change I needed was {menu start_level='2' } so I don't have to modify any menu or template code as I add additional sites.<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">$config['assume_mod_rewrite'] = true;<br />$config['page_extension'] = '.html';<br />$config['use_hierarchy'] = false;<br /></div><br /><br /><br />This saves me about 40 full installations of CMSMS.</div> <br clear="all" /><br /> <table width="100%" cellspacing="0"> <tr valign="middle"> <td class="gensmall" align="right"> </td> </tr> </table> </td> </tr> </table> </td> </tr> <tr class="row2"> <td class="profile"><strong><a href="#wrapheader">Top</a></strong></td> <td><div class="gensmall" style="float: left;"> <a href="./memberlist.php?mode=viewprofile&u=7255"><img src="./styles/subsilver2/imageset/en/icon_user_profile.gif" alt="Profile" title="Profile" /></a>  </div> <div class="gensmall" style="float: right;"> </div></td> </tr> <tr> <td class="spacer" colspan="2" height="1"><img src="images/spacer.gif" alt="" width="1" height="1" /></td> </tr> </table> <table class="tablebg" width="100%" cellspacing="1"> <tr class="row1"> <td align="center" valign="middle"> <a name="p263270"></a> <b class="postauthor">jbx1</b> </td> <td width="100%" height="25"> <table width="100%" cellspacing="0"> <tr> <td class="gensmall" width="100%"><div style="float: left;"> <b>Post subject:</b> Re: Multiple domains and sites, ONE CMSMS!</div><div style="float: right;"><a href="./viewtopic.php?p=263270#p263270"><img src="./styles/subsilver2/imageset/icon_post_target.gif" width="12" height="9" alt="Post" title="Post" /></a><b>Posted:</b> Sun Oct 02, 2011 11:07 pm </div></td> </tr> </table> </td> </tr> <tr class="row1"> <td valign="top" class="profile"> <table cellspacing="4" align="center" width="150"> <tr> <td><img src="./styles/subsilver2/imageset/en/icon_user_offline.gif" alt="Offline" title="Offline" /></td> </tr> <tr> <td class="postdetails">Forum Members</td> </tr> <tr> <td><img src="./images/ranks/star.gif" alt="Forum Members" title="Forum Members" /></td> </tr> </table> <span class="postdetails"> <br /><b>Joined:</b> Mon Apr 05, 2010 12:15 am<br /><b>Posts:</b> 15 </span> </td> <td valign="top"> <table width="100%" cellspacing="5"> <tr> <td> <div class="postbody">Regarding step 9 of the original post, with User Defined Tags, one can avoid having to modify the template with ugly {if} conditions. <br /><br />One can have a user defined tag like: {multi_sitename}<br />and it would have something like: <br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">$multi_sitenames = array("www.domain1.com" => "The First Domain", "www.domain2.com" => "The second domain.");<br /><br />echo $multi_sitenames[$_SERVER['HTTP_HOST']];<br /></div><br /><br /><br />Then in the page templates, one just replaces {sitename} with {multi_sitename} in the <title> tag.</div> <br clear="all" /><br /> <table width="100%" cellspacing="0"> <tr valign="middle"> <td class="gensmall" align="right"> </td> </tr> </table> </td> </tr> </table> </td> </tr> <tr class="row1"> <td class="profile"><strong><a href="#wrapheader">Top</a></strong></td> <td><div class="gensmall" style="float: left;"> <a href="./memberlist.php?mode=viewprofile&u=24374"><img src="./styles/subsilver2/imageset/en/icon_user_profile.gif" alt="Profile" title="Profile" /></a>  </div> <div class="gensmall" style="float: right;"> </div></td> </tr> <tr> <td class="spacer" colspan="2" height="1"><img src="images/spacer.gif" alt="" width="1" height="1" /></td> </tr> </table> <table width="100%" cellspacing="1" class="tablebg"> <tr align="center"> <td class="cat"><form name="viewtopic" method="post" action="./viewtopic.php?f=4&t=22890"><span class="gensmall">Display posts from previous:</span> <select name="st" id="st"><option value="0" selected="selected">All posts</option><option value="1">1 day</option><option value="7">7 days</option><option value="14">2 weeks</option><option value="30">1 month</option><option value="90">3 months</option><option value="180">6 months</option><option value="365">1 year</option></select> <span class="gensmall">Sort by</span> <select name="sk" id="sk"><option value="a">Author</option><option value="t" selected="selected">Post time</option><option value="s">Subject</option></select> <select name="sd" id="sd"><option value="a" selected="selected">Ascending</option><option value="d">Descending</option></select> <input class="btnlite" type="submit" value="Go" name="sort" /></form></td> </tr> </table> <table width="100%" cellspacing="1"> <tr> <td align="left" valign="middle" nowrap="nowrap"> <a href="./posting.php?mode=post&f=4"><img src="./styles/subsilver2/imageset/en/button_topic_new.gif" alt="Post new topic" title="Post new topic" /></a> <a href="./posting.php?mode=reply&f=4&t=22890"><img src="./styles/subsilver2/imageset/en/button_topic_reply.gif" alt="Reply to topic" title="Reply to topic" /></a> </td> <td class="nav" valign="middle" nowrap="nowrap"> Page <strong>1</strong> of <strong>1</strong><br /></td> <td class="gensmall" nowrap="nowrap"> [ 13 posts ] </td> <td class="gensmall" width="100%" align="right" nowrap="nowrap"></td> </tr> </table> </div> <div id="pagefooter"></div> <br clear="all" /> <table class="tablebg" width="100%" cellspacing="1" cellpadding="0" style="margin-top: 5px;"> <tr> <td class="row1"> <p class="breadcrumbs"><a href="./index.php">Board index</a> » <a href="./viewforum.php?f=72">Community Boards</a> » <a href="./viewforum.php?f=4">Tips and Tricks</a></p> <p class="datetime">All times are UTC </p> </td> </tr> </table> <br clear="all" /> <table class="tablebg" width="100%" cellspacing="1"> <tr> <td class="cat"><h4>Who is online</h4></td> </tr> <tr> <td class="row1"><p class="gensmall">Users browsing this forum: No registered users</p></td> </tr> </table> <br clear="all" /> <table width="100%" cellspacing="1"> <tr> <td width="40%" valign="top" nowrap="nowrap" align="left"></td> <td align="right" valign="top" nowrap="nowrap"><span class="gensmall">You <strong>cannot</strong> post new topics in this forum<br />You <strong>cannot</strong> reply to topics in this forum<br />You <strong>cannot</strong> edit your posts in this forum<br />You <strong>cannot</strong> delete your posts in this forum<br />You <strong>cannot</strong> post attachments in this forum<br /></span></td> </tr> </table> <br clear="all" /> <table width="100%" cellspacing="0"> <tr> <td><form method="post" name="search" action="./search.php?t=22890"><span class="gensmall">Search for:</span> <input class="post" type="text" name="keywords" size="20" /> <input class="btnlite" type="submit" value="Go" /></form></td> <td align="right"> <form method="post" name="jumpbox" action="./viewforum.php" onsubmit="if(document.jumpbox.f.value == -1){return false;}"> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td nowrap="nowrap"><span class="gensmall">Jump to:</span> <select name="f" onchange="if(this.options[this.selectedIndex].value != -1){ document.forms['jumpbox'].submit() }"> <option value="-1">Select a forum</option> <option value="-1">------------------</option> <option value="70">Official Boards</option> <option value="40">   README FIRST!!!</option> <option value="1">   Announcements</option> <option value="2">   General Discussion</option> <option value="3">   Installation, Setup and Upgrade</option> <option value="8">   Product Support</option> <option value="6">   Developers Discussion</option> <option value="23">   Accessability and Usability</option> <option value="19">   Quality Assurance</option> <option value="14">   Documentation</option> <option value="16">      Suggestions, Modifications & Corrections</option> <option value="15">   Translations</option> <option value="74">   CMSMS 1.10 Beta</option> <option value="75">      Closed Issues</option> <option value="72">Community Boards</option> <option value="76">   Geek Moot 2012</option> <option value="5">   CMS Show Off</option> <option value="35">   Media and presentations about CMSMS</option> <option value="34">   Help Wanted (commercial)</option> <option value="4" selected="selected">   Tips and Tricks</option> <option value="20">   Layout and Design (CSS & HTML)</option> <option value="7">   Modules/Add-Ons</option> <option value="21">   Feature ideas</option> <option value="28">   The Lounge</option> <option value="41">   Locked: CMSMS MLE fork</option> <option value="48">      Modules/Addon patchs</option> <option value="66">   Locked: Geek Moot 2010</option> <option value="73">International Discussions</option> <option value="42">   Czech/Slovak - Česky/Slovensky</option> <option value="9">   Danish - Dansk</option> <option value="13">   Dutch - Nederlands</option> <option value="51">      Aankondigingen</option> <option value="52">      Tips en Trucs</option> <option value="53">      Vertalingen & Documentatie</option> <option value="54">      Hulp gezocht (commercieel)</option> <option value="55">      Showroom</option> <option value="78">   Finnish - Suomi</option> <option value="10">   French - Français</option> <option value="11">   German - Deutsch</option> <option value="43">      BITTE ZUERST LESEN !!!</option> <option value="63">      Ankündigungen</option> <option value="24">      Installation und Einstellungen</option> <option value="25">      Module und Tags</option> <option value="50">      Smarty-Tipps und -Tricks</option> <option value="32">      Layout und Design</option> <option value="61">      Suchmaschinenoptimierung (SEO)</option> <option value="67">      HowTo's</option> <option value="49">      Übersetzungen</option> <option value="26">      Show Off</option> <option value="47">      Hilfe gesucht (kommerziell)</option> <option value="31">      Stammtisch</option> <option value="45">   Hungarian - Magyar</option> <option value="29">   Italian - Italiano</option> <option value="36">      Moduli/Plugins</option> <option value="33">   Lithuanian - Lietuviškai</option> <option value="60">      Darbo / bendradarbiavimo pasiūlymai ir paieška</option> <option value="59">   Persian / Farsi</option> <option value="12">   Polish - Polski</option> <option value="46">   Portuguese - português</option> <option value="27">   Russian - русский</option> <option value="56">      Предложения и поиск РАБОТЫ</option> <option value="30">   Spanish - Español</option> <option value="22">   Swedish - Svenska</option> </select> <input class="btnlite" type="submit" value="Go" /></td> </tr> </table> </form> </td> </tr> </table> </div> </div> <!-- We request you retain the full copyright notice below including the link to www.phpbb.com. This not only gives respect to the large amount of time given freely by the developers but also helps build interest, traffic and use of phpBB3. If you (honestly) cannot retain the full copyright we ask you at least leave in place the "Powered by phpBB" line, with "phpBB" linked to www.phpbb.com. If you refuse to include even this then support on our forums may be affected. The phpBB Group : 2006 //--> </div> <div id="contentbtm"> <div id="adbox"> <a rel="nofollow" href="http://www.cmsmadesimple.org/index.php?mact=Banners,cntnt01,link,0&cntnt01banner_id=1&cntnt01category_id=1&cntnt01returnid=15" title="Arvixe"><img src="http://www.cmsmadesimple.org/uploads/partner_banners/Arvixe.gif" width="728" height="90" alt="Arvixe - A CMSMS Partner"/></a> </div> </div> </div> <div id="foot"> <div id="footer"> <div id="wrapfooter"> <span class="copyright">Powered by <a href="http://www.phpbb.com/">phpBB</a> © 2000, 2002, 2005, 2007 phpBB Group<br /> </span> </div> </div> </div> </div> </body> </html>