Multi-locale pages 404 on subdirectories I'm developing and running a Craft site locally through Laravel Homestead and am having issues with pages 404'ing in a multi-locale setup.

I've followed this guide closely: https://craftcms.com/docs/localization-guide and still running into problems.

Basically, I want to have a Spanish locale set up, with English as the default top level. So my example.com/xyz-article will be the English version, and example.com/es/xyz-article will be the Spanish version.

Here is how my folder structure is set up:

craft/
public/
   .htaccess
   index.php
   es/
      index.php
      .htaccess


My craft/config/general.php is set up like this:

return array(
    '*' =&gt; array(
        'omitScriptNameInUrls' =&gt; true,
    ),

    '.dev' =&gt; array(
        'devMode' =&gt; true,
        'userSessionDuration'           =&gt; 'P101Y',
        'rememberedUserSessionDuration' =&gt; 'P101Y',
        'rememberUsernameDuration'      =&gt; 'P101Y',
        'invalidLoginWindowDuration'    =&gt; 'P101Y',
        'cooldownDuration'              =&gt; 'PT1S',
        'maxInvalidLogins'              =&gt; 101,
        'siteUrl' =&gt; array(
            'en_us' =&gt; 'http://example.dev/',
            'es' =&gt; 'http://example.dev/es/',
        )
    ),
);


My index.php file under the public/es directory looks like this:

&lt;?php

// Path to your craft/ folder
$craftPath = '../../craft';

// Tell Craft to serve the Spanish content
define('CRAFT_LOCALE', 'es');

// Do not edit below this line
$path = rtrim($craftPath, '/').'/app/index.php';

if (!is_file($path))
{
    if (function_exists('http_response_code'))
    {
        http_response_code(503);
    }

    exit('Could not find your craft/ folder. Please ensure that &lt;strong&gt; &lt;code&gt;$craftPath&lt;/code&gt;&lt;/strong&gt; is set correctly in '.__FILE__);
}

require_once $path;


Finally, both of my .htaccess files inside the public and es directories are identical and look like this:

&lt;IfModule mod_rewrite.c&gt;
    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]
&lt;/IfModule&gt;


Going to example.dev brings up the English homepage just fine, and example.dev/es brings up the Spanish homepage just fine. Everything looks good so far...but when I try to navigate into subdirectories, the es/ pages always 404's. 

For instance, I set up a Single called "Testing", enabled it for both locales, and pointed it to a template inside my craft/templates folder called testing/index.html. example.dev/testing brings up the English version, but example.dev/es/testing gives me a 404 error.

The odd thing is, is that the ugly version of the URL at http://example.dev/index.php/es?p=testing brings up the Spanish version, and Live Preview also works and displays/updates when I'm working on the Spanish version of the page.

I'm at a bit of a loss as to where I'm going wrong here -- it seems like some paths are just screwy but I can't find where I may have entered something in incorrectly. Any help would be appreciated!

UPDATE: Here are the log errors I'm getting when I load the es/testing page.
I was running into the same issue, struggling with it and it turns out that the official documentation is a bit misleading (no offense) when it comes to the .htaccess file, because it just mentions to copy it: 

You can not just copy the .htaccess but you have to change the RewriteBase parameter according to your folder structure in the /public folder.

In your case the .htaccess file in the /public folder should start like this:

&lt;IfModule mod_rewrite.c&gt;
    RewriteEngine On
    RewriteBase /

    (...)


Within your /public/es folder you should have the following in the .htaccess:

&lt;IfModule mod_rewrite.c&gt;
    RewriteEngine On
    RewriteBase /es/

    (...)


Hope that helps!

TL;DR —> The RewriteBase in the .htaccess has to be changed according to the folder setup of the locales