0

Is there a way to configure EE to allow it to be accessed from more than one URL? Our site has some multilingual capabilities, and we would like to be able to offer users in some areas the ability to access the site from domains that are appropriate for the language.

We are having problems when the Site URL and Themes URL are not based off the same FQDN.

If we put the FQDN in the "Site URL" field, the site overwrites the inbound URL with the site URL on the first click within the site.

If we replace the FQDN with "/" the site works OK for browsing and preserves the inbound DN in the URL. However resources accessed via the Themes URL setting (e.g. Font Files) fail as browser fail to load them due to 'cross-origin resource sharing' preferences.

If we replace the Themes URL with "/themes" we get various page-link 'not found' errors when trying to access pages via category based links.

Is there an established solution to this issue? I cannot believe we are the first to encounter it...

Thanks a lot in advance for any / all help.

1

It sounds like you need to take a look at the Multiple Site Manager add-on from EllisLab.

| improve this answer | |
  • We do have an MSM license. But we're not trying support multiple sites, just all the same site to be accessed using more than one URL. – JCOGS Design Apr 1 '15 at 15:35
1

What are you trying to accomplish? We typically allow multiple domains to point to the same site, but then use .htaccess to redirect them to a single, canonical domain. This would prevent your issue, as well as protect you from duplicate content SEO penalties.

| improve this answer | |
  • At its simplest, what we are trying to achieve is what is outlined in question. Mostly because we use Publisher to support multi-lingual versions of our site, and would like to allow access to these via custom URLs across a whole visit rather than be redirected to a different URL either on arrival (.htaccess) or on first click (site_url). – JCOGS Design Apr 1 '15 at 15:50
1

Isn't that hard to make a bilingual website.

On your config.php, set some variables on a domain basis. For example:

$protocol      = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://';
$domain        = str_replace('www.', '', $_SERVER['HTTP_HOST']);
$base_url      = $protocol . $_SERVER['HTTP_HOST'];

$config['site_url'] = $base_url;
$config['cp_url'] = $base_url.'/system.php';

$config['avatar_path'] = $_SERVER['DOCUMENT_ROOT'] . '/images/avatars';
$config['avatar_url'] = $base_url.'/images/avatars/';
$config['captcha_path'] = $_SERVER['DOCUMENT_ROOT'] . '/images/captchas';
$config['captcha_url'] = $base_url.'/images/captchas/';
$config['theme_folder_path'] = $_SERVER['DOCUMENT_ROOT'] . '/themes';
$config['theme_folder_url'] = $base_url.'/themes/';
$config['path_third_themes'] = $_SERVER['DOCUMENT_ROOT'] . '/addons_themes';
$config['url_third_themes'] = $base_url.'/addons_themes/';

For the language settings:

global $assign_to_config;
if(!isset($assign_to_config['global_vars']))
$assign_to_config['global_vars'] = array();
if ( $domain == 'domain.com.br')
{
    $assign_to_config['xml_lang']   =
    $assign_to_config['language']   = 'pt';
    $config['reserved_category_word'] = 'categoria';
}
else // the default domain
{
    $assign_to_config['xml_lang']   =
    $assign_to_config['language']   = 'en';
    $config['reserved_category_word'] = 'category';
}

To use root relative links to all your assets is a good idea too.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.