title: RewriteRule - two parameters but last parameter is optional
body: <p>I cannot rewrite to include two parameters but the last parameter is optional, so for example:</p>
  
  <blockquote>
    <p><a href="http://www.mywebsite.com/friends/jamie" rel="noreferrer">http://www.mywebsite.com/friends/jamie</a> - (the forward slash should be optional too). Which should be the same as this:</p>
  </blockquote>
  
  <pre><code>http://www.mywebsite.com/friends.php?name=jamie
  </code></pre>
  
  <p>When including a second parameter</p>
  
  <blockquote>
    <p><a href="http://www.mywebsite.com/friends/jamie/30" rel="noreferrer">http://www.mywebsite.com/friends/jamie/30</a>  - Should be the same as this:</p>
  </blockquote>
  
  <pre><code>http://www.mywebsite.com/friends.php?name=jamie&amp;page=30
  </code></pre>
  
  <p>This rule does not work:</p>
  
  <pre><code>RewriteRule ^friends/(.*)/(.*)$ friends.php?name=$1&amp;page=$2
  </code></pre>
  
  <p>Because I get this: <code>The requested URL /friends/jamie was not found on this server.</code> but works if I include a page number for the second parameter, so basically the second parameter should be optional.</p>