title: 301 Redirect with .htaccess
body: <pre><code>Options +FollowSymlinks
  RewriteEngine on
  
  RewriteBase /
  RewriteCond %{REQUEST_URI} !^category?$
  RewriteRule ([^/]+)/([^/]+)/([^/]+)/$ http://domain.com/$3/ [L,R=permanent]
  </code></pre>
  
  <p>Currently I have the following redirection and it is working like a charm. Now I want to make sure that the link does not begins with /category/ therefore I have inserted the condition. Unfortunately it does not seems to work. Please help. Thanks.</p>
  
  <p>Another question is, how to make that the end permalink that is between the slash is selected to be redirected only. For example, I may have links like <a href="http://domain.com/downloads/26-fine-wallpapers/" rel="nofollow">http://domain.com/downloads/26-fine-wallpapers/</a> and <a href="http://domain.com/downloads/icons/35-nice-icons/" rel="nofollow">http://domain.com/downloads/icons/35-nice-icons/</a> and I want links like these to be redirected to <a href="http://newdomain.com/35-nice-icons/" rel="nofollow">http://newdomain.com/35-nice-icons/</a> and <a href="http://newdomain.com/26-fine-wallpapers/" rel="nofollow">http://newdomain.com/26-fine-wallpapers/</a></p>
  
  <p>I am using wordpress actually.</p>