title: Apache - rewrite jpg to URL with .htaccess
body: <p>Hi im trying to do redirect from .jpg file to specific URL address but it don't work. Can sb help me?</p>
  
  <pre><code>RewriteEngine On
  RewriteBase /
  RewriteCond %{REQUEST_URI} ^/(.*)\.jpg [NC]
  RewriteRule ^/up/([\w]*\.jpg)$ /file?name=$1[R=301,L]
  </code></pre>
  
  <p>for eg.: i have image www.mydomain.com/up/image.jpg</p>
  
  <p>and i would like to redirect it under: www.mydomain.com/file?name=image.jpg</p>