title: Dynamic SEO Friendly URLs in Yii
body: <p>I want to use custom dynamic seo friendly urls in yii.</p>
  
  <p>I read all kind of articles and they all say the same thing.</p>
  
  <p>This is what i managed to find so far, and it does not suit my needs:</p>
  
  <pre><code>    'urlManager'=&gt;array(
          'urlFormat'=&gt;'path',
          'rules'=&gt;array(
              '&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;',
  </code></pre>
  
  <p>or</p>
  
  <pre><code>array(
       '&lt;_c:(post|comment)&gt;/&lt;id:\d+&gt;/&lt;_a:(create|update|delete)&gt;'=&gt;'&lt;_c&gt;/&lt;_a&gt;',
       '&lt;_c:(post|comment)&gt;/&lt;id:\d+&gt;'=&gt;'&lt;_c&gt;/view',
       '&lt;_c:(post|comment)&gt;s/*'=&gt;'&lt;_c&gt;/list',
  )
  </code></pre>
  
  <p>I dont need urls like: domain.com/a/b/c/d</p>
  
  <p>I need: domain.com/here-goes-the-article-title-ACTION-ID</p>
  
  <p>I need a expression that can identify the article title.</p>
  
  <p>This is how one of my urls looks like: <a href="http://www.linkbook.ro/concurs-castiga-o-invitatie-de-trei-zile-de-festival-la-bestfest-2012-detailsU-2-882.html" rel="nofollow">http://www.linkbook.ro/concurs-castiga-o-invitatie-de-trei-zile-de-festival-la-bestfest-2012-detailsU-2-882.html</a></p>
  
  <p>where concurs-castiga-o-invitatie-de-trei-zile-de-festival-la-bestfest-2012 is the article title</p>
  
  <p>detailsU is the action</p>
  
  <p>2 is the database id</p>
  
  <p>882 is the article id</p>