title: Yii2: Remove controller from URL
body: <p>I am using the advanced template.
  I created all my actions on the SiteController, so all my urls are domain.com/site/something, and I need to remove the word &quot;site&quot; from the url so it will be domain.com/something.</p>
  <p>I tried the following rules based on <a href="https://stackoverflow.com/questions/29577022/remove-controller-name-from-urls-in-yii2">this question</a></p>
  <pre><code>'urlManager' =&gt; [
          'class' =&gt; 'yii\web\UrlManager',
          'showScriptName' =&gt; false,
          'enablePrettyUrl' =&gt; true,
          'rules' =&gt; array(
                  '/&lt;action:\w+&gt;/&lt;id:\d+&gt;' =&gt; 'site/&lt;action&gt;',
                  '/&lt;action:\w+&gt;' =&gt; 'site/&lt;action&gt;',
                  '/noticia/&lt;slug&gt;' =&gt; 'site/noticia',
          ),
      ],
  </code></pre>
  <p>also tried this based on <a href="https://stackoverflow.com/questions/38272745/yii2-how-to-remove-site-index-and-page-parameter-from-url">this other question</a>:</p>
  <pre><code>'urlManager' =&gt; [
          'class' =&gt; 'yii\web\UrlManager',
          'showScriptName' =&gt; false,
          'enablePrettyUrl' =&gt; true,
          'baseUrl' =&gt; 'http://localhost/websites/transcita/app/frontend/web',
          'rules' =&gt; array(
                  [
                      'pattern' =&gt; '&lt;action:\w+&gt;',
                      'route' =&gt; 'site/&lt;action&gt;'
                   ],
                  [
                      'pattern' =&gt; '&lt;action:\w+&gt;/&lt;id:\d+&gt;',
                      'route' =&gt; 'site/&lt;action&gt;'
                   ],
                  '/noticia/&lt;slug&gt;' =&gt; 'site/noticia',
          ),
      ],
  </code></pre>
  <p>but neither is not working. I get a 404 when I type domain.com/something.
  I also tried without the first / and it didn't work either.</p>
  <p>Any thoughts?</p>