title: Yii2 URL Route for make a Slug Url
body: <p>I'm learning on yii2, 
  I have a problem when make a url route.
  here's my url configuration</p>
  
  <pre><code>'urlManager' =&gt; [
              'class' =&gt; 'yii\web\UrlManager',
              // Disable index.php
              'showScriptName' =&gt; false,
              // Disable r= routes
              // 'enableStrictParsing' =&gt; false,
              'enablePrettyUrl' =&gt; true,
              'rules' =&gt; array(                   
                  'category/&lt;id:\S+&gt;' =&gt; 'category/detail',
                  '&lt;controller:\w+&gt;/&lt;id:\d+&gt;' =&gt; '&lt;controller&gt;/view',
                  '&lt;controller:\w+&gt;/&lt;action:\w+&gt;/&lt;id:\d+&gt;' =&gt; '&lt;controller&gt;/&lt;action&gt;',
                  '&lt;controller:\w+&gt;/&lt;action:\w+&gt;' =&gt; '&lt;controller&gt;/&lt;action&gt;',
                  'request-password-reset' =&gt; 'site/request-password-reset',
                  'reset-password/&lt;token:\S+&gt;' =&gt; 'site/reset-password',  
                  'profile/&lt;id:[0-9a-zA-Z\-]+&gt;/?' =&gt; 'profile/user',  
                  'logout' =&gt; 'site/logout',
                  'login' =&gt; 'site/login',
  
              ),
          ],
  </code></pre>
  
  <p>The problem is in profile routing.
  Here's the case: </p>
  
  <ol>
  <li><a href="http://localhost/myapps/profile/some-url/" rel="nofollow">http://localhost/myapps/profile/some-url/</a> -> work with added slash in 
  the end of url </li>
  <li><a href="http://localhost/myapps/profile/some-url" rel="nofollow">http://localhost/myapps/profile/some-url</a> -> without slash in end of url isn't working and error 404</li>
  <li><a href="http://localhost/myapps/profile/someurl" rel="nofollow">http://localhost/myapps/profile/someurl</a> -> not working error 404.</li>
  <li><a href="http://localhost/myapps/profile/first-second-third" rel="nofollow">http://localhost/myapps/profile/first-second-third</a> -> with our without slash in the end is working</li>
  </ol>
  
  <p>I'm really confuse, I've been looking for previous question here and try out nothing working with my case. </p>
  
  <p>Can somebody help with my problem? </p>