title: Custom Wordpressplugin causes trouble with nginx rewrite
body: <p>I have a big problem with nginx and it's wordpress-rules for redirecting/permalinks.</p>
  
  <p>So here is what we have:</p>
  
  <ol>
  <li>A blog using permalinks (/%category%/%postname%/)</li>
  <li>nginx</li>
  <li>A custom plugin (product comparision) which was coded on a dev-system</li>
  </ol>
  
  <p>Under normal circumstances we just need to use the following nginx-line:</p>
  
  <pre><code>try_files $uri $uri/ /index.php?$args;
  </code></pre>
  
  <p>But it does not work with the new plugin! I mean I can access all categorys, posts and so on.</p>
  
  <p>Now when the plugin is used there is another section (page) where users can compare different products. The problem is, that this plugin uses the following linkstructure:
  /compare/product-name/123 
  123 is the product-ID.</p>
  
  <p>On the dev-system we did just this:</p>
  
  <pre><code>rewrite ^/compare/([a-z0-9-]+)/([0-9]+)?$ /?page_id=32134&amp;id=$2 break;
  </code></pre>
  
  <p>This worked just fine (on the dev-system where the permalink feature wasnt active).</p>
  
  <p>After activating the permalink stuff and adding</p>
  
  <pre><code>rewrite ^/compare/([a-z0-9-]+)/([0-9]+)?$ /?page_id=PAGEIDOFLIVESYSTEM&amp;id=$2 break;
  location / {
  try_files $uri $uri/ /index.php?$args;
  }
  </code></pre>
  
  <p>to my nginx conf, wordpress says that it could not find an article. </p>
  
  <p>I think there is a conflict with the rewrite rules, but I have no idea how to solve it after trying different stuff.</p>
  
  <p>Maybe someone has a good idea!</p>
  
  <p>Regards &amp; excuse my bad english!</p>
  
  <p>Bye</p>