1

I get a 404 page when I try to open an Italian page. Homepage www.domain.com/it/ works, but when I proceed to www.domain.com/it/assistenza-e-supporto it gives me a 404.

English version works. Any idea where I should look to fix this?

I've followed the steps as desribed here: https://craftcms.com/docs/localization-guide

Config looks like this:

return array(
    'cpTrigger' => 'admin',
    'omitScriptNameInUrls' => true,
    'devMode' => true,
    'siteUrl' => array(
        'en_US' => 'http://local.crafttraining.craft.dev/',
        'es' => 'http://local.crafttraining.craft.dev/es/',
        'it' => 'http://local.crafttraining.craft.dev/it/',
    ),
);

Update: After a day of trying and searching I found out that once I remove the omitScriptNameInUrls from the general.php it works fine, but I would like to have nice url's.

.htaccess looks like this:

<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>

What am I doing wrong. Thanks for helping me out with this.

6
  • You sure you've enabled Italian for section you're trying to view?
    – Brad Bell
    Jul 15, 2015 at 19:18
  • Hi Brad, yep, did that. The strange thing is that the italian homepage works perfectly on: local.crafttraining.craft.dev/it. In this file I have {% set pages = craft.entries.section('contentPages').level(1) %}. {% for page in pages %} <li>{{ page.getLink() }}</li> {% endfor %} This generates the links to the italian pages. Eg: local.crafttraining.craft.dev/it/assistenza-e-supporto. Now, when I click that link, I get a 404 page. I checked the docs once more, but cannot find what I am doing wrong.
    – Tom Suter
    Jul 16, 2015 at 6:17
  • Does your server support PATH_INFO? buildwithcraft.com/help/enable-path-info
    – Brad Bell
    Jul 16, 2015 at 18:04
  • Hi Brad, your answer helpt me a littlebit further. This works: 'usePathInfo' => true, 'omitScriptNameInUrls' => false, so url's are with index.php: craft.dev/index.php/it/news-it/2015/we-just-installed-craft. If I set omitScriptNameInUrls to true it doesn't work anymore. 404's all over the place.
    – Tom Suter
    Jul 17, 2015 at 12:26
  • Do you have the correct RewriteBase in it/.htaccess? I think I saw that causing 404s somewhere.
    – megatrond
    Jul 20, 2015 at 13:17

1 Answer 1

0

Found it (at last). The thing was that the . before .htaccess was removed when copying the files to the /it/ folder on OSx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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