title: Wordpress simple rewrite rule not working
body: <p>I'm trying to create a rewrite rule in Wordpress to create direct pretty links to search results.</p>
  
  <p>I'm working with a custom post type called 'object'</p>
  
  <p>My result page is located at this url : <a href="http://www.domain.com/objects/" rel="nofollow">http://www.domain.com/objects/</a></p>
  
  <p>I want to create this kind of URL to point a listing of new objects : <a href="http://www.domain.com/objects/new" rel="nofollow">http://www.domain.com/objects/new</a></p>
  
  <p>The rewritten query must be : <a href="http://www.domain.com/objects/?filter=new" rel="nofollow">http://www.domain.com/objects/?filter=new</a></p>
  
  <p>I will then be able to use the $_GET['filter'] value to query my objects (meta_query)...</p>
  
  <p><strong>my problem</strong></p>
  
  <p>I've try to to this with this code:</p>
  
  <pre><code>add_rewrite_tag('%filter%','([^&amp;]+)');
  add_rewrite_rule('objects/new/','objects/?filter=new','top');
  </code></pre>
  
  <p>.htaccess looks then like this:</p>
  
  <pre><code># BEGIN WordPress
  &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.php$ - [L]
  RewriteRule ^objects/new/ /objects/?filter=new [QSA,L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
  &lt;/IfModule&gt;
  # END WordPress
  </code></pre>
  
  <p>Unfortunately, when I try to reach the URL <em><a href="http://www.domain.com/objects/new" rel="nofollow">http://www.domain.com/objects/new</a></em> I've got a 404 error :(</p>
  
  <p>Debug bar show me this:</p>
  
  <pre><code>Request:
     objects/new
  
  Query String:
     attachment=new
  
  Matched Rewrite Rule:
     [^/]+/([^/]+)/?$
  
  Matched Rewrite Query:
     attachment=new
  </code></pre>
  
  <p>Can someone tell me why Wordpress try to retrieve an attachment? 
  Is something wrong in my rewrite rule or am I missing something?</p>
  
  <p>Thanks in advance for your help!</p>