0

I have my two locales set up as described in the official documentation.

I am able to translate my pages and fields in the CP as supposed to and have two versions ready in the backend, both with a green dot behind them.

However, when I try to access any page apart from the homepage in my 2nd locale in the frontend I get a 404 error.

DE is my first locale, placed within the /public/ folder. EN is my second locale, placed within the /public/en/ folder with the index.php referring to ../../craft as shown in the official docs and the same .htaccess copied from the parent /public/ folder.

Furthermore, this is my general.php setup for the local development server, where I can not see any obvious mistakes yet:

'.develop' => array(
  'rootUrl' => 'http://deque.develop:8888/',
'siteUrl' => array(
    'de' => 'http://deque.develop:8888/',
    'en' => 'http://deque.develop:8888/en/',
  ),
  'environmentVariables' => array(
  'baseUrl'  => 'http://deque.develop:8888',
  'basePath' => 'http://deque.develop:8888',
  'devMode' => true,
)

I did not write the /en/ in any of the CP settings, only have the correct translations for the URL string there, so that should be no issue. The URLs are rendered fine and as supposed in the Frontend anyway. It’s just that a 404 is displayed for any English pages instead of the actual content.

In Craft’s log file I could only find this hinting at something:

2018/04/13 12:52:20 [error] [exception.Craft\HttpException.404] Craft\HttpException in /Users/Tobias/Development/deque_2018/craft/app/controllers/TemplatesController.php:72

Any hints where I might be making a mistake?

2

However, when I try to access any page apart from the homepage in my 2nd locale in the frontend I get a 404 error.

Could it be, that as a result of your settings, URL's for /en do not get rewritten correctly? I don't know how you redirect SEO-friendly urls, but most of the times (at least in my life) if accessing all pages but the homepage fails, it has something to do with URL rewriting.

  • You think the .htaccess could be the culprit? – Tobias S. Apr 16 '18 at 14:28
  • It might be, did you change it at all after copying it to the /en folder? What does the redirect line look like? – Paul Apr 16 '18 at 14:29
  • RewriteRule (.+) index.php?p=$1 [QSA,L] – Tobias S. Apr 16 '18 at 14:47

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.