title: .htaccess rule: redirect parameter to filename
body: <p>How can I redirect the following example:</p>
  
  <p><a href="http://www.mypage.tld/media/optivo/ch/de/?id=0805610075C6000" rel="nofollow noreferrer">http://www.mypage.tld/media/optivo/ch/de/?id=0805610075C6000</a> </p>
  
  <p>to</p>
  
  <p><a href="http://www.mypage.tld/media/optivo/ch/de/0805610075C6000.xml" rel="nofollow noreferrer">http://www.mypage.tld/media/optivo/ch/de/0805610075C6000.xml</a></p>
  
  <p>So the parameter value should be the filename with an .xml extension</p>
  
  <p>I tried: </p>
  
  <pre><code>RewriteCond %{QUERY_STRING} (?:^|&amp;)id=([^&amp;]+)  
  RewriteRule ^media/optivo/ch/de/$ $0%1.xml [L,R=permanent]
  </code></pre>