So I've setup locales following the official guide and am going with the option where English (en_gb) is the default and Danish (da_dk) is in a sub-folder:
http://mysite.com --> en default
http://mysite.com/dk/ --> dk sub-folder
In summary, I've set the locales in Settings -> Locales
I've enabled them for my section (which is a channel):
I've set the siteURL array (single domain config):
'siteUrl' => array(
'en' => 'http://mysite.com',
'dk' => 'http://mysite.com/dk/',
),
I've created the folder structure and copied the index.php file and .htaccess file across to the dk/
folder:
craft/
public_html/ --> mysite.com/
.htaccess
index.php
dk/ --> mysite.com/dk/
.htaccess
index.php
And I've made the edit to the dk/index.php
file:
// Path to your craft/ folder
$craftPath = '../../craft';
// Tell Craft to serve the Danish content
define('CRAFT_LOCALE', 'dk');
Viewing my entry in English works fine:
http://mysite.com/segment/title --> Shows in English
Viewing the same entry in Danish directs to:
http://mysite.com/danishsegment/title --> Missing /dk/ in URL. Nothing shown
So the preview link for Denmark doesn't include the country segment in the URL (dk/
) and results in a 404. Even manually adding dk/
to the URL results in a 404. It doesn't seem to be recognising the Danish locale at all.
Any ideas as to what I'm doing wrong?
UPDATE:
Here are the contents of my .htaccess files. All standard Craft with a Type to ensure PHP 5.6 is used:
AddType x-httpd-php56 .php
<IfModule mod_rewrite.c>
RewriteEngine On
# Send would-be 404 requests to Craft
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
RewriteRule (.+) index.php?p=$1 [QSA,L]
</IfModule>
UPDATE 2:
The 'Offers' section (Channel) is set to have a different URL for each Locale:
.htaccess
in the Danish locale directory?/dk/
segment to the URL - even when clicking on the link in the Entries panel of Craft. It doesn't include the/dk/
part in the URL and adding it results in a 404.http://mysite.com/dk/
shows the index page but the custom Section URL for Denmark is added or apparently working./etc/httpd/vhosts/hostname.conf
, but I do have the locale prepended in the rewrite for the one multilocale site I have running:RewriteRule (.+) /en/index.php?p=$1 [QSA,L]