title: mod_rewrite for sub directory
body: <p>I have a domain and a sub folder, called "sub"..inside "sub" is index.php which has this:</p>
  
  <pre><code>$page = $_GET['page'];
  switch ($page)
  {
      case "main":
          echo "main";
          break;
      case "task_orders":
          echo "task_orders";
          break;
      case "team_members":
          echo "team_members";
          break;
      case "team_experience":
          echo "team_experience";
          break;
      case "quality_assurance":
          echo "quality_assurance";
          break;
      case "geographical_support":
          echo "geographical_support";
          break;
      case "contact":
          echo "contact";
          break;
      default:
          echo "main";
  }
  </code></pre>
  
  <p>my htaccess in "sub" is:</p>
  
  <pre><code>Options +FollowSymLinks
  RewriteEngine On
  
  RewriteRule ^sub/([^/\.]+)/?$ index.php?page=$1 [L]
  </code></pre>
  
  <p>when I click a link which looks like:</p>
  
  <pre><code>&lt;li&gt;&lt;a href="/sub/main" title="Main" class="current"&gt;Main&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="/sub/task_orders" title="Task Orders"&gt;Task Orders&lt;/a&gt;&lt;/li&gt; 
  &lt;li&gt;&lt;a href="/sub/team_members" title="Team Members"&gt;Team Members&lt;/a&gt;&lt;/li&gt; 
  &lt;li&gt;&lt;a href="/sub/team_experience" title="Team Experience"&gt;Team Experience&lt;/a&gt;&lt;/li&gt; 
  &lt;li&gt;&lt;a href="/sub/quality_assurance" title="Quality Assurance Program"&gt;Quality Assurance&lt;/a&gt;&lt;/li&gt; 
  &lt;li&gt;&lt;a href="/sub/geographical_support" title="Geographical Support"&gt;Geographical Support&lt;/a&gt;&lt;/li&gt; 
  &lt;li&gt;&lt;a href="/sub/contact" title="Points of Contact"&gt;Points of Contact&lt;/a&gt;&lt;/li&gt; 
  </code></pre>
  
  <p>I get a page not found rather than echoing out what page I am on, any ideas?</p>
  
  <p>I also tried:</p>
  
  <pre><code>RewriteRule ^/sub/([^/\.]+)/?$ /sub/index.php?page=$1 [L]
  </code></pre>
  
  <p>and same result</p>