title: optional parameter in url rewriting
body: <p>I'm using apache and .htacess to rewrite my urls.</p>
  
  <p>I would like to have an optional parameter "mess" in my ad.php page. I wrote :</p>
  
  <pre><code>RewriteRule    ^ad-([A-Za-z0-9-]+)/?$    ad.php?id=$1    [NC,L]
  RewriteRule    ^ad-([A-Za-z0-9-]+)-([A-Za-z0-9-]+)/?$    ad.php?id=$1&amp;mess=$2    [NC,L]
  </code></pre>
  
  <p>But it seems that only the first rule is considered. ad-100 and ad-100-1 should give different things but they don't. When I remove The first Rule, ad-100 is not working anymore (obviously) and ad-100-1 is now working because it's taking the second rule.</p>
  
  <p>Do you know how I can have optional parameters ? Should I combine the two rule in one ?</p>