title: How put string in url routing rules in yii2?
body: <p>In yii2 I have controller:</p>
  
  <pre><code>public function actionRequest($date) {
  ...
  }
  </code></pre>
  
  <p>I need url <code>request/2015-12-03</code> instead of <code>request?date=2015-12-03</code></p>
  
  <p>So, how to get date from routing if it is string or date? This does not work (page not found):
  <code>'user/request/&lt;date:\w+&gt;' =&gt; 'user/request'</code></p>
  
  <p>The strange thing is that <code>view</code>, <code>update</code> and <code>delete</code> actions work good. Url <code>request?date=2015-12-03</code> also works. I use Apache server.
  main.php:</p>
  
  <pre><code>'components' =&gt; [
          'request' =&gt; [
              'baseUrl' =&gt; '',
          ],
          'urlManager' =&gt; [
              'baseUrl' =&gt; '',
              'enablePrettyUrl' =&gt; true,
              'showScriptName' =&gt; false,
              'rules' =&gt; [
                  'user/view/&lt;id:\d+&gt;' =&gt; 'user/view', // works
                  'user/update/&lt;id:\d+&gt;' =&gt; 'user/update', // works
                  'user/delete/&lt;id:\d+&gt;' =&gt; 'user/delete', // works
                  'user/request/&lt;date:\d{4}-\d{2}-\d{2}&gt;' =&gt; 'user/request', // doesn't work
                  'user/request/&lt;date:\w+&gt;' =&gt; 'user/request', // doesn't work
                  [
                      'pattern' =&gt; 'login',
                      'route' =&gt; 'user/login',
                  ],
                  [
                      'pattern' =&gt; 'logout',
                      'route' =&gt; 'user/logout',
                  ],
              ],
          ],
          ...
  ]
  </code></pre>
  
  <p>.htaccess is from this article <a href="http://www.yiiframework.com/wiki/755/how-to-hide-frontend-web-in-url-addresses-on-apache/" rel="nofollow">http://www.yiiframework.com/wiki/755/how-to-hide-frontend-web-in-url-addresses-on-apache/</a>
  .htaccess in root:</p>
  
  <pre><code>Options -Indexes
  
  &lt;IfModule mod_rewrite.c&gt; 
    RewriteEngine on
  
    RewriteCond %{REQUEST_URI} !^public
    RewriteRule ^(.*)$ frontend/web/$1 [L] 
  &lt;/IfModule&gt;
  
  # Deny accessing below extensions
  &lt;Files ~ "(.json|.lock|.git)"&gt;
  Order allow,deny
  Deny from all
  &lt;/Files&gt;
  
  # Deny accessing dot files
  RewriteRule (^\.|/\.) - [F]
  </code></pre>
  
  <p>.htaccess in /frontend/web:</p>
  
  <pre><code>RewriteEngine on
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d 
  
  RewriteRule . index.php
  </code></pre>