title: Rewrite URL with multiple parameters
body: <p>I have a URL that sometimes has one or more parameters and I want to be able to rewrite accordingly.</p>
  
  <p>The URLs are as follows:</p>
  
  <pre><code>/index.php?pagetitle=Home
  </code></pre>
  
  <p>I have managed to get this URL to display how I want using the following:</p>
  
  <pre><code>/Home
  </code></pre>
  
  
  
  <pre><code>RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-l
  RewriteRule ^([0-9a-zA-Z]+) index.php?pagetitle=$1 [NC,L]
  </code></pre>
  
  <p>I would also like to be able to have the same URL, but with article ID</p>
  
  <pre><code>.com/index.php?pagetitle=Home&amp;articleid=20
  </code></pre>
  
  <p>which i would like to display like this:</p>
  
  <pre><code>.com/Home/20
  </code></pre>
  
  <p>But I can't seem to figure out how to get it to work on more than one parameter.</p>
  
  <p>UPDATE: 
  Ok so i managed to get the below to work using :
      index.php?pagetitle=$1&amp;articleid=$2</p>
  
  <p>Which displays as:
      .com/Home/20</p>
  
  <p>I have tried to take it a step further and be able to use the article title as well the rule i tried is as follows.</p>
  
  <pre><code>RewriteRule ^([0-9a-zA-Z]+)(?:/([0-9a-zA-Z]+))(?:/([0-9]*))?/?$ index.php?pagetitle=$1&amp;articletitle=$2&amp;articleid=$3 [NC,L,QSA]
  </code></pre>
  
  <p>So would display as :
      .com/Home/ArticleTitle/20</p>
  
  <p>But it doesnt want to work for me does any one know what i am doing wrong and thanks again in advance.</p>
  
  <p><a href="http://karpium.co.uk/Home/Baits/20" rel="nofollow">http://karpium.co.uk/Home/Baits/20</a> - This Url Works </p>
  
  <p><a href="http://karpium.co.uk/Home" rel="nofollow">http://karpium.co.uk/Home</a> - But this url doesnt work where as it does when just using the pagetitle= and articleid=</p>