title: Mod-rewrite trailing slash and additional $GET
body: <p>I need a little help with some mod_rewrite syntax, currently I have</p>
  
  <pre><code>RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?page=$1
  </code></pre>
  
  <p>Which display mydomain.com/index.php?page=testpage when a user goes to mydomain.com/testpage.</p>
  
  <p>There are two more things I want to do but playing around with other examples haven't be able to do so far.</p>
  
  <p>Firstly, I want to make mydomain.com/testpage/ to work just like mydomain.com/testpage works whereby the trailing slash has no effect on functionality.</p>
  
  <p>Secondly, I want to add a second variable that may not always be present so that mydomain.com/testpage/testvar will display mydomain.com/index.php?page=testpage&amp;var=testvar</p>
  
  <p>Any help is much appreciated.</p>
  
  <p>Thanks in advance.</p>