title: htaccess rule for moved pdf files?
body: <p>I've tried, I really have...I give in. Wordpress and htaccess...oh the pain.</p>
  
  <p>Old static site has pdf, doc, xls and zip files all in the root. I've loaded all the files as media items so they all live in /wp-content/uploads. </p>
  
  <p>I simply want to catch any 404 which is a .pdf file and redirect it to the upload folder. Should be easy but I'm clearly not doing something right. htaccess has soooo many flags and settings that something much be clashing or I'm just not "getting it".</p>
  
  <pre><code>RewriteEngine On
  
  # Catch incorrect case (must be a better way of doing this?)
  RewriteCond %{REQUEST_FILENAME} !-f  
  RewriteRule (.*)\.JPG$ $1.jpg [L,R=301] 
  
  RewriteCond %{REQUEST_FILENAME} !-f  
  RewriteRule (.*)\.PNG$ $1.png [L,R=301] 
  
  RewriteCond %{REQUEST_FILENAME} !-f  
  RewriteRule (.*)\.GIF$ $1.gif [L,R=301] 
  
  # BEGIN WordPress
  RewriteBase /
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
  # END WordPress
  
  # Start of my woes...what am I doing wrong?
  RewriteCond %{REQUEST_FILENAME} .*\.pdf [NC]
  #RewriteCond %{REQUEST_FILENAME} !\/wp-content\/uploads\/
  RewriteRule ([^/]*\.pdf) /wp-content/uploads/$1 [NC,L,R=301] 
  
  RewriteCond %{REQUEST_FILENAME} !-f  
  RewriteRule ([^\/]*.zip) /wp-content/uploads/$1 [L,R=301] 
  
  RewriteCond %{REQUEST_FILENAME} !-f  
  RewriteRule ([^\/]*.xls) /wp-content/uploads/$1 [L,R=301] 
  
  # For bonus points, is this the correct way to do this? Catch old reference to an old folder and move them on?
  RedirectMatch 301 /Graphic\sFiles/(.*\.jpg) /wp-content/uploads/$1
  RedirectMatch 301 /Graphic\sFiles/(.*\.png) /wp-content/uploads/$1
  RedirectMatch 301 /Graphic\sFiles/(.*\.gif) /wp-content/uploads/$1
  </code></pre>
  
  <p>I've been working off:</p>
  
  <ul>
  <li><a href="http://httpd.apache.org/docs/current/rewrite/flags.html" rel="nofollow">http://httpd.apache.org/docs/current/rewrite/flags.html</a></li>
  <li><a href="http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewriterule" rel="nofollow">http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewriterule</a></li>
  <li><a href="http://httpd.apache.org/docs/current/rewrite/remapping.html#fallback-resource" rel="nofollow">http://httpd.apache.org/docs/current/rewrite/remapping.html#fallback-resource</a></li>
  </ul>
  
  <p>Soooo many rules to take in for what I thought was one simple job. I'm no htaccess guru and never will be, I have plenty of respect for those that are though!</p>
  
  <p>Thanks for any pointers in advance ladies and gents.</p>
  
  <p>Pete</p>