title: User-friendly URLs in Yii
body: <p>I've been doing some experiments with Yii, to see if it will suit my needs. The first thing I wanted to enable was the user-friendly URLs.</p>
  
  <p>What I want to achieve: to go from this URL <code>webapproot/index.php?r=site/contact</code> to this URL <code>webapproot/contact</code>.</p>
  
  <p>What I've done:</p>
  
  <ul>
  <li>Created an aplication using Yiic (<code>php YiiRoot/framework/yiic.php webapp testdrive</code>)</li>
  <li>Followed the steps 2 and 6 of <a href="http://www.yiiframework.com/doc/guide/1.1/en/topics.url">this link from Yii's documentation</a> ("User-friendly URLs" and "Hiding index.php").</li>
  </ul>
  
  <p>What happens is that I keep getting a 404. Any ideas of what I did wrong?</p>
  
  <p>Below are some relevant excerpts to this question:</p>
  
  <h2>[project root]/protected/config/main.php</h2>
  
  <pre><code>(...)
  'urlManager'=&gt;array(
      'urlFormat'=&gt;'path',
      'showScriptName'=&gt;false,
      '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>
  
  <h2>[project root]/.htaccess</h2>
  
  <pre><code>RewriteEngine on
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  
  RewriteRule . index.php
  </code></pre>
  
  <h2>/etc/apache2/httpd.conf</h2>
  
  <pre><code>(...)
  LoadModule rewrite_module libexec/apache2/mod_rewrite.so
  (...)
  &lt;Directory [path to my web projects folder]&gt;
      Options FollowSymLinks
      AllowOverride All
      Order deny,allow
  &lt;/Directory&gt;
  (...)
  </code></pre>