title: Yii2 how to rewrite url without controller name
body: <p>I am rewriting my yii2 website urls.In my config file i added</p>
  <pre><code>'&lt;category_name&gt;-&lt;controller&gt;-&lt;category_id&gt;'=&gt;'&lt;controller&gt;/index'
  </code></pre>
  <p>and in the url i just passed the parameters like</p>
  <pre><code>&lt;?=Url::to(['shop/index','category_id'=&gt;1,'category_name'=&gt;'clothes'])?&gt;
  </code></pre>
  <p>And my url comes like</p>
  <pre><code>https://example.com/clothes-shop-1
  </code></pre>
  <p>This is  what i am getting. But i need something like</p>
  <pre><code>https://example.com/clothes-1
  </code></pre>
  <p>for that i just changed the rule like this</p>
  <pre><code>'&lt;category_name&gt;-&lt;category_id&gt;'=&gt;'&lt;controller&gt;/index'
  </code></pre>
  <p>But that time rewriting doesn't working.How can i remove the controller name from that url</p>