title: Yii2 advances app rest api pretty url not working
body: <p>This is my folder structure </p>
  
  <pre><code>-api
     -config
        main.php
     -web
        .htaccess
  
  -backend
     -config
        main.php
     -web
        .htaccess
  
  -frontend
      -config
        main.php
     -web
        .htaccess
  </code></pre>
  
  <p>in my <code>api/main.php</code> I enabled pretty url. This is my url manager</p>
  
  <pre><code>'urlManager' =&gt; [
      'enablePrettyUrl' =&gt; true,
      'showScriptName' =&gt; false,
      'rules' =&gt; [
          [
              'class' =&gt; 'yii\rest\UrlRule',
              'controller' =&gt; [
                  'user',
                  'site'
              ],
              'extraPatterns' =&gt; [
                  'POST,OPTIONS search' =&gt; 'search',
                  'GET site/error'=&gt;'error'
  
              ]
          ],
      ],
  ],
  </code></pre>
  
  <p>and I configured <code>my api/web/.htaccess</code> also </p>
  
  <pre><code>RewriteEngine On
  # If a directory or a file exists, use the request directly
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  # Otherwise forward the request to index.php
  RewriteRule . index.php
  </code></pre>
  
  <p>but for every url I am getting the default <code>site/index</code> result. When I remove pretty url code it is working also code it is working in my local,but not working in my server. Do I need to change anything in .htaccess ?
  my yii-app url in server is like <code>www.servername/my-yii-app/api/web</code>. Any idea?</p>