title: How to Rewrite a Rule in htaccess
body: <p>I have a few dozen links, that are generating a page not found error because of the parameters in query-string:</p>
  
  <pre><code>http://www.domain.com/publication?id=test
  http://www.domain.com/publication?id=test&amp;tkn=25MMI7
  http://www.domain.com/publication?id=VfgodzE4Akg&amp;tkn=25GJK02&amp;gid=VCsfkQENp4g:20150323:s
  </code></pre>
  
  <p>I want to be able to redirect them to:</p>
  
  <pre><code>http://www.domain.com/publication/?id=test
  http://www.domain.com/publication/?id=test&amp;tkn=25MMI7
  http://www.domain.com/publication/?id=VfgodzE4Akg&amp;tkn=25GJK02&amp;gid=VCsfkQENp4g:20150323:s
  </code></pre>
  
  <p>I have access to the .htaccess file, but I have no experience with the syntax. </p>
  
  <p>How can I do this?</p>
  
  <p>Thanks a lot.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I ended up using the following rewrite rule that looks for anything after the '?' sign:</p>
  
  <pre><code>RewriteRule /publication/?\?(.*) /publication/?$1 [NC,L]
  </code></pre>
  
  <p>So far it seems to be working as I needed. </p>
  
  <p>Thank you for your help.</p>