title: WordPress rewrite URL to access plugin page
body: <p>Hi i am trying to access my plugin via a custome URL but i am unable to get the plugin to redirect, it just comes up 404 page not found, whereas what i want is page.php to be called instead. My plugin code is below (activate and deactivate functions of the plugin):</p>
  
  <pre><code>register_activation_hook(__FILE__,'activate');
  register_deactivation_hook(__FILE__,'deactivate');
  
  function setRewriteRules()
  {
      add_rewrite_rule( 'plugin-url/$', '/wp-content/plugins/my-plugin/page.php', 'top' );
  }
  
  function activate() 
  {       
      setRewriteRules();
  
      global $wp_rewrite;
      $wp_rewrite-&gt;flush_rules(true);  
  
  }
  
  function deactivate()
  {
      global $wp_rewrite;
      $wp_rewrite-&gt;flush_rules(true);  
  }
  </code></pre>
  
  <p>Any ideas what i am doing wrong?</p>
  
  <p>Thanks in advance,</p>
  
  <p>Chris</p>