Multiple country domains, same site/content - how do you set things up in site.php?

Permalink
After doing bit of reading about the best way of handling different country domains directing to one site, we've decided to just go with the google recommendation of pointing different country domains at the same site.

There was a post talking about adding the following to site.php:
define('REDIRECT_TO_BASE_URL', false);


This will supposedly leave the domain as whatever the user entered to get to the site. But in order for c5 to recognize both domains, do we just add them both to site.php like this:
<?php 
define('DB_SERVER', 'serveraddress');
define('DB_USERNAME', 'username');
define('DB_PASSWORD', 'password');
define('DB_DATABASE', 'databasename');
define('BASE_URL', 'http://domain-one.com');
define('BASE_URL', 'http://domain-one.com.au');
define('DIR_REL', '');
define('REDIRECT_TO_BASE_URL', false);
define('PASSWORD_SALT', 'PSALT');?><?php define('DIRNAME_APP_UPDATED', 'concrete5.4.2');?>


Looking to go live in the next few hours but obviously want to set this up right - any suggestions would be welcome.

Cheers

Ben

 
Pritam replied on at Permalink Reply
cmscss replied on at Permalink Reply
Thanks for that - have you used the plugin?

I'm confused by the documentation with regard to redirecting http://site.com TO http://www.site.com.

Will it do it for multiple domains or just the one BASE_URL_DEFAULT domain. i.e., I would like:
http://site.com ->http://www.site.com
http://site.com.au ->http://www.site.com.au

Or should I use 301 redirects for this?

Cheers
Pritam replied on at Permalink Reply
I haven't used it as it was released in the market-place a week ago, you could use the "Pre-sale question" link on this add-on page to ask questions about proper usage of this add-on
cmscss replied on at Permalink Reply
Thinking about it, couldn't I just comment out BASE_URL and DIR_REL then use 301 redirects to direct the non-www domains?

Or will the site not work properly unless BASE_URL is defined?
cmscss replied on at Permalink Reply
So in the end I used this in the site.php file:
<?php 
define('DB_SERVER', 'serveraddress');
define('DB_USERNAME', 'username');
define('DB_PASSWORD', 'password');
define('DB_DATABASE', 'databasename');
define('PASSWORD_SALT', 'PSALT');?><?php define('DIRNAME_APP_UPDATED', 'concrete5.4.2');?>


Then redirected the non-www domain in each country's virtual host setup like this:
<VirtualHost *:80>
   ServerAdmin webmaster@localhost
   ServerName www.domain.com
...normal virtual host config items and error logs etc...
</VirtualHost>
<VirtualHost *:80>
   ServerName domain.com
   Redirect permanent / http://www.domain.com
</VirtualHost>


This seems to work fine except for a couple of things:

CHANGES NOT BEING PUBLISHED ACROSS ALL DOMAINS:
I made some changes while logged in on the main country domain and published the changes - this worked as expected.

But when I viewed the same page using the other country domain, the changes weren't there - I had to clear the c5 cache before they did.

SITEMAP.XML ONLY CONTAINS ONE DOMAIN
Just wondering if I shouldn't use a sitemap.xml file for this website as the loc data is for one domain - maybe just let google index the site pages organically under each country's domain?

Sorry if this is obvious but I'm not super technical in this department.

Any help would be appreciated.

Cheers

Ben
cmscss replied on at Permalink Reply
Hmmm, I think my setup is causing a cache issue - I have to update the cache to publish the changes to the other country domain each time changes are made (the main country domain is all sweet).

Does anyone know what I've done wrong - just couldn't find much info in the site.php file and the consequences/features available.