title: htaccess dynamic url rewrite and 301 redirect
body: <p>I have a website with a dynamic main page, in which only one image changes, the url looks like this:</p>
  
  <p><a href="http://mysite.com/?v=imagename.jpg" rel="nofollow">http://mysite.com/?v=imagename.jpg</a></p>
  
  <p>i am trying to find a rule to redirect all these url's to:</p>
  
  <p><a href="http://mysite.com/imagename" rel="nofollow">http://mysite.com/imagename</a></p>
  
  <p>I have tried:</p>
  
  <pre><code>RewriteCond %{QUERY_STRING} ^(([^&amp;]*&amp;)*)v=([^&amp;]+)&amp;?(.*)?$
  RewriteRule ^index\.php$ http://mysite.com/3?%1%4 [L,R=301]
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>RewriteRule ^index.php?v=([a-zA-Z]+)/([0-9]+)$ http://mysite.com/$1
  </code></pre>
  
  <p>and countless other variations, but nothing seems to work .. what am i doing wrong?</p>