title: redirect posts to new address
body: <p>I've change permalink of my wordpress site from</p>
  
  <pre><code>/%category%/%postname%/
  </code></pre>
  
  <p>to</p>
  
  <pre><code>%postname%
  </code></pre>
  
  <p>I've tested this code:</p>
  
  <pre><code>RedirectMatch 301 ^/([^/]+)/([^/]+)/([^/]+)/([^/]+)/$ site.com/$4
  RedirectMatch 301 ^/([^/]+)/([^/]+)/([^/]+)/$ site.com/$3
  </code></pre>
  
  <p>and good work for redirect posts but this code redirect categories address too and show 404 not found page.</p>
  
  <p>I need to only redirect old posts address to new address.
  Is it possible that only the posts be redirect?</p>
  
  <p>Example:</p>
  
  <pre><code>site.com\cat1\subcat\post
  redirect to:
  site.com\post (no problem)
  </code></pre>
  
  <p>my site Categories in two or three level</p>
  
  <p>two level not have problem but three level:</p>
  
  <pre><code>site.com\cat1\subcat\subcat2
  (Categories should not be redirect)
  but redirect to:
  site.com\subcat2 (and Error 404 Not Found)
  </code></pre>