title: Redirect all URLs to homepage except core WordPress files
body: <p>I've recently gained access to a domain which used to have a very large site and product base, however the old host turned it off and all the URLs are lost. I am using WordPress on the domain (previously it used an e-com shop called Kyrptronic) and have set up a simple landing page. So far there are over 20,000 not found URLs and I need them to redirect to the homepage (except for css and jpg files that I am using on the landing page). </p>
  
  <p>I tried to redirect all old links straight to homepage however this means the core wordpress files become inaccessable and when you try and click anything in the backend E.g. Plugins - it redirects to the homepage. Here is the code I used in the htaccess file.</p>
  
  <pre><code># BEGIN WordPress
  &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteBase /
  RewriteCond %{REQUEST_URI} !/$
  RewriteCond %{REQUEST_URI} !\.(gif|jpe?g|png|css|js|xml)$
  RewriteRule (.*) / [R=301,L]
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
  &lt;/IfModule&gt;
  
  # END WordPress
  </code></pre>
  
  <p>Is there a htaccess code snippet that can redirect all URLs other than jpgs, pngs and NOT the entire wordpress and website directory with .php file extensions?</p>
  
  <p>The site has too many not found URLs to do one by one.</p>
  
  <p>Hope this makes sense, it's my first post on here!!</p>
  
  <p>Thanks</p>