title: Yii2: REST API - 404 error
body: <p>DataBase has table with saved Tweets. </p>
  
  <p>There is controller:</p>
  
  <pre><code>&lt;?php
  
  namespace app\controllers;
  
  use yii\rest\ActiveController;
  
  class TweetController extends ActiveController
  {
      public $modelClass = 'app\models\Tweet';
  }
  </code></pre>
  
  <p>Corresponding model <code>app\model\Tweet</code> created by <code>gii</code>.</p>
  
  <p>In <code>app\web\config</code> added:</p>
  
  <pre><code>..............
      'components' =&gt; [
          'urlManager' =&gt; [
              'enablePrettyUrl' =&gt; true,
              'enableStrictParsing' =&gt; true,
              'showScriptName' =&gt; false,
              'rules' =&gt; [
                  ['class' =&gt; 'yii\rest\UrlRule',
                   'controller' =&gt; 'tweet'],
              ],
          ],
          'request' =&gt; [
                   'parsers' =&gt;['application/json' =&gt; 'yii\web\JsonParser', ],
          ],
  ...............
  </code></pre>
  
  <p>In <code>app\web</code> added <code>.htaccess</code> according <a href="http://www.yiiframework.com/doc-2.0/guide-tutorial-shared-hosting.html" rel="nofollow">http://www.yiiframework.com/doc-2.0/guide-tutorial-shared-hosting.html</a></p>
  
  <p>In <code>apache</code> DocumentRoot as <code>app\web</code></p>
  
  <p>According yii2 docs: <code>curl -i -H "Accept:application/json" "http://localhost/tweets"</code> must return paged model data. Instead of this:</p>
  
  <pre><code>HTTP/1.1 404 Not Found
  Date: Tue, 29 Mar 2016 14:04:05 GMT
  Server: Apache/2.4.7 (Ubuntu)
  Content-Length: 278
  Content-Type: text/html; charset=iso-8859-1
  
  &lt;!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"&gt;
  &lt;html&gt;&lt;head&gt;
  &lt;title&gt;404 Not Found&lt;/title&gt;
  &lt;/head&gt;&lt;body&gt;
  &lt;h1&gt;Not Found&lt;/h1&gt;
  &lt;p&gt;The requested URL /tweets was not found on this server.&lt;/p&gt;
  &lt;hr&gt;
  &lt;address&gt;Apache/2.4.7 (Ubuntu) Server at localhost Port 80&lt;/address&gt;
  &lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>Also tryed - urlManager <code>'controller' =&gt; ['tw' =&gt; 'tweet']</code> whit according url.</p>
  
  <p>why there is 404? Guided by <a href="http://www.yiiframework.com/doc-2.0/guide-rest-quick-start.html" rel="nofollow">http://www.yiiframework.com/doc-2.0/guide-rest-quick-start.html</a></p>
  
  <p>added: well... url should be <code>http://localhost/index.php/tweets</code> but it`s not obviously for me.</p>