Solution - Multi Site with google Analytics Guide

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
User avatar
Phoenix
Forum Members
Forum Members
Posts: 19
Joined: Mon Jul 14, 2008 9:53 am

Solution - Multi Site with google Analytics Guide

Post by Phoenix »

1.Have domains pointing to main domain type where cms is installed

2. Changes to Config.php
#$config['root_url'] = 'http://'. $_SERVER['SERVER_NAME'];
$config['root_url'] = 'http://'. $_SERVER['HTTP_HOST'];

3. Set domain type in Template



{global_content name='domaintype'}

4. Create Global Content domain type
{* some initial setup *} {* strip www. dots and dashes from server host name and assign to a variable for later use *} {assign var=tldtype value=$smarty.server.HTTP_HOST|replace:'www.':''} {if $tldtype eq 'domain.co.za'}    {assign var=tld value='.co.za'}{* tld is this domains domain type *} {elseif $tldtype eq 'domain.com'}    {assign var=tld value='.com'} {elseif $tldtype eq 'domain.net'} {assign var=tld value='.net'} {else}    {assign var=tld value='.'} {/if} {* end setup *}

5. Use tld in site variables example below Google analytics* place in template
{global_content name="$tld-analytics"}
6. Create Global Content variable for each tld
.co.za-analytics



.com-analytics




Note Multi site seemed to work better by removing www via htaccess , better for SEO as well
#Remove www
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain.net$ [NC]
RewriteRule ^(.*)$ http://domain.net/$1 [R=301,L]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain.co.za$ [NC]
RewriteRule ^(.*)$ http://domain.co.za/$1 [R=301,L]

External php still has issues even with UDT
Last edited by Phoenix on Wed Jul 16, 2008 9:17 am, edited 1 time in total.
Post Reply

Return to “CMSMS Core”