title: htaccess: Simplify a long Rewriterule
body: <p>I want to write my .htaccess file, so I have this part</p>
  
  <p>(ex: <a href="http://www.mysite.com/tutorial/php/bydate/p7" rel="nofollow">http://www.mysite.com/tutorial/php/bydate/p7</a> )</p>
  
  <pre><code>RewriteRule ^(album|tutorial)/(.*)/(bydate|byuser|byrate|bypost)/(asc|desc)/p([0-9]+)$ $1.php?cat=$2&amp;sort=$3&amp;order=$4&amp;p=$5 [QSA]
  RewriteRule ^(album|tutorial)/(.*)/(bydate|byuser|byrate|bypost)/(asc|desc)/$ $1.php?cat=$2&amp;sort=$3&amp;order=$4 [QSA]
  RewriteRule ^(album|tutorial)/(.*)/(bydate|byuser|byrate|bypost)/p([0-9]+)$ $1.php?cat=$2&amp;sort=$3&amp;p=$4 [QSA]
  RewriteRule ^(album|tutorial)/(.*)/(bydate|byuser|byrate|bypost)/$ $1.php?cat=$2&amp;sort=$3 [QSA]
  RewriteRule ^(album|tutorial)/(.*)/(asc|desc)/p([0-9]+)$ $1.php?cat=$2&amp;order=$3&amp;p=$4 [QSA]
  RewriteRule ^(album|tutorial)/(.*)/(asc|desc)/$ $1.php?cat=$2&amp;order=$3 [QSA]
  RewriteRule ^(album|tutorial)/(.*)/p([0-9]+)$ $1.php?cat=$2&amp;p=$3 [QSA]
  RewriteRule ^(album|tutorial)/(.*)/$ $1.php?cat=$2 [QSA]
  </code></pre>
  
  <p>My questions is: </p>
  
  <p>1- is it better to use that? Or is sufficient</p>
  
  <pre><code>RewriteRule ^(album|tutorial)/(.*)/$ $1.php?cat=$2 [QSA]
  </code></pre>
  
  <p>(ex: <a href="http://www.mysite/tutorial/php/?sort=bydate&amp;order=desc&amp;p=2" rel="nofollow">http://www.mysite/tutorial/php/?sort=bydate&amp;order=desc&amp;p=2</a>)</p>
  
  <p>And I treat the parameters in my php file ? </p>
  
  <p>2- If I want to use the first part, is it any way to simplify it?</p>