title: htaccess regular expression
body: <p>I would like to create an htaccess rule that will leave regular urls untouched, but will redirect friendly urls to a page I call display.php with variables.</p>
  
  <p>So if a user enters the address www.mydomain.com/test.php, he will go to test.php.</p>
  
  <p>But if a user enters www.mydomain.com/test or www.mydomain.com/test/, he will go to display.php?view=test</p>
  
  <p>if a user enters www.mydomain.com/test/one/ the server will load display.php?view=test/one</p>
  
  <p>Thanks</p>
  
  <p>I have it working on iis URL rewrite, but something goes wrong when I tried converting the code to mod_rewrite. The attached code causes all pages, even index.php to be redirected to display.php, which is wrong.</p>
  
  <pre><code>RewriteRule ^/display\.php$    {C:1}/{C:2}
  RewriteRule ^([^/]+)/([^/]+)/?$    display.php?view=$1&amp;option=$2
  RewriteRule ^/display\.php$    {C:1}
  RewriteRule ^([^/]+)/?$    display.php?view=$1
  </code></pre>