title: add rewrite_rules in WordPress custom plugin
body: <p>i try to <code>short url</code> of my custome page that in <code>my-pugin</code></p>
  
  <p>when i use my custom page i will url like bellow</p>
  
  <pre><code>http://localhost/wordpress/wp-content/plugins/my-plugin/testurl.php
  </code></pre>
  
  <p>but i want this</p>
  
  <pre><code>http://localhost/wordpress/testurl
  </code></pre>
  
  <p>i write this code in my plugin</p>
  
  <pre><code>function create_rewrite_rules($rules) {
          //print_r($rules);
          global $wp_rewrite;
          $newRule = array('/testurl' =&gt; 'wp-content/plugins/my-plugin/testurl.php');
          //echo $newRule;
          $newRules = $newRule + $rules;
          //$newRules = $newRule;
          // echo "&lt;pre&gt;";
          // print_r($newRules);
          return $newRules;
      }
  
      function flush_rewrite_rules() {
          //echo 1;
          global $wp_rewrite;
          $wp_rewrite-&gt;flush_rules();
      }
  
  if(class_exists('MyPlugin'))
      $myPlugin = new MyPlugin();
  
  add_filter('rewrite_rules_array', array($myPlugin, 'create_rewrite_rules'));
  add_filter('init', array($myPlugin, 'flush_rewrite_rules'));
  </code></pre>
  
  <p>but it cant help.</p>