title: htaccess rule delimiters and params for smooth urls
body: <p>I'm trying to use htaccess rewrite rules to create smooth urls.  So that the user can call for example <code>http://members.clubseat.at/demo/login/?test=123</code> and for my code it is like the user called <code>http://members.clubseat.at/demo/index.php?page=login&amp;test=123</code>.</p>
  
  <p>here is my htaccess code:</p>
  
  <pre><code>RewriteEngine On
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  
  RewriteRule ^([^/]*/)?([^/]*)/?$ ./index.php?p1=$1&amp;p2=$2 [QSA,L]
  </code></pre>
  
  <p>I want that the user can leave the additional params after the page and also the last slash, so that <code>.../demo/login/</code> and <code>.../demo/login</code> also work. But if there is no last slash (<strong>/</strong>) <code>login</code> is not in the first param but in the second.</p>
  
  <p>compare: 
  <a href="http://members.clubseat.at/demo/login/" rel="nofollow">http://members.clubseat.at/demo/login/</a> <strong>vs.</strong>
  <a href="http://members.clubseat.at/demo/login" rel="nofollow">http://members.clubseat.at/demo/login</a></p>
  
  <p>try demo here: <a href="http://members.clubseat.at/demo/login/?test=123" rel="nofollow">http://members.clubseat.at/demo/login/?test=123</a></p>
  
  <p>but according to regex-tester it should work: <a href="https://regex101.com/r/nK9rM2/2" rel="nofollow">https://regex101.com/r/nK9rM2/2</a></p>
  
  <p>how can i solve this problem?</p>